@21epub/resource-lib
v4.12.2
Published
## Usage
Downloads
685
Keywords
Readme
resource-lib
Usage
import React from 'react'
import {
AssetsRecoilRoot,
AssetsModal,
useAssetsModalState,
} from '@21epub/resource-lib'
const Button = () => {
const [assetsModalState, dispatch] = useAssetsModalState({
visible: false,
type: 'image',
})
return (
<button onClick={() => dispatch({ visible: !assetsModalState.visible })} />
)
}
const App = () => (
<AssetsRecoilRoot>
<AssetsModal getPath={() => ''} />
<Button />
</AssetsRecoilRoot>
)
export default App