React Utility Custom Hook Package
npm install @frfla/react-hooks
yarn add @frfla/react-hooks
pnpm add @frfla/react-hooks
- A useState hook for using boolean state conveniently
- example
const [display, show, hide, toggle] = useBooleanState(initialState)
- If
initialState
is not provided as an argument, the default state value is set to false. - DOCS
- A React hook for using conditional render easily
- useful in triggering animation with (un)mounting component
- DOCS
- A React hook for debounced effect/state
- DOCS
- A React hook for forcibly rendering a component
- DOCS
- In an SSR environment, useEffect should be used, while on the client side, useLayoutEffect should be utilized.
- helps prevent hydration errors
- DOCS
- A React hook for using Modal easily
- DOCS
- React hooks for using numbers easily
- DOCS
- A React hook for copying plain text to clipboard
- other types will be provided later
- example:
const [ copy, isCopied, restoreState ] = useTextCopy(duration, onError)
- works only in localhost or https
- DOCS
- A React hook for using form easily
- During the beta period, the API may unexpectedly change or new features may be added
- supports
textarea
andinput
(type text, number, checkbox) - provides APIs,
createUseFormContext
anduseFormContext
for integrating with Context API - DOCS