@deep-foundation/react-with-packages-installed
TypeScript icon, indicating that this package has built-in type declarations

0.5.3 • Public • Published

npm

Goal

This package provides a component that wraps the react hook useArePackageInstalled from the package @deep-foundation/react-use-are-packages-installed. Loading, error, not installed and installed states are handled by the components you pass.

How to use?

<WithPackagesInstalled
  packageNames={["package-name0", "package-name1"]}
  renderIfError={(error) => <div>{error.message}</div>}
  renderIfNotInstalled={(packageNames) => (
    <div>
      {`Install these deep packages to proceed: ${packageNames.join(', ')}`}
    </div>
  )}
  renderIfLoading={() => (
    <Text>Checking if deep packages are installed...</Text>
  )}
  shouldIgnoreResultWhenLoading={true}
>
  <Content />
</WithPackagesInstalled>;

Package Sidebar

Install

npm i @deep-foundation/react-with-packages-installed

Weekly Downloads

118

Version

0.5.3

License

none

Unpacked Size

5.91 kB

Total Files

6

Last publish

Collaborators

  • timax
  • likissdmd
  • prinz_eugen_deep
  • senchapencha
  • korvusmkrt
  • suenot
  • romanxz
  • flakeed
  • l4legenda
  • aruseli
  • freephoenix888
  • konard
  • menzorg
  • ivansglazunov