@21epub/resource-lib
TypeScript icon, indicating that this package has built-in type declarations

4.12.2 • Public • Published

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

Readme

Keywords

none

Package Sidebar

Install

npm i @21epub/resource-lib

Weekly Downloads

13

Version

4.12.2

License

none

Unpacked Size

368 kB

Total Files

63

Last publish

Collaborators

  • csj117
  • gary.guzy
  • zhangwei0126
  • dxsix
  • wagon1104
  • ongyuxing