Returns the asset source view and the asset source props, such as onSelect and onClose.
onSelect
onClose
Throws when the component does not render in an asset source view.
export default function MyAssetSource() { const {view, onClose} = useAssetSource() return <button onClick={onClose}>Close {view.title}</button>} Copy
export default function MyAssetSource() { const {view, onClose} = useAssetSource() return <button onClick={onClose}>Close {view.title}</button>}
Returns the asset source view and the asset source props, such as
onSelectandonClose.Throws when the component does not render in an asset source view.