6.6.0 • Published 5 years ago

@teasim/ui-hooks v6.6.0

Weekly downloads
-
License
MIT
Repository
github
Last release
5 years ago

ui-hooks

base on react-use

Usage

You need to have React 16.8.0 or later installed to use the Hooks API. You can import each hook individually

import useToggle from '@bridge5/ui-hooks/lib/useToggle';

or use ES6 named imports

import { useToggle } from '@bridge5/ui-hooks';

Depending on your bundler you might run into a missing dependency error with ES6 named import statements. Some hooks require you to install peer dependencies so we recommend using individual imports. If you want the best of both worlds you can transform the named import statements to individual import statements with babel-plugin-import by adding the following config to your .babelrc file:

[
  "import",
  {
    "libraryName": "@bridge5/ui-hooks",
    "libraryDirectory": "lib",
    "camel2DashComponentName": false
  }
]