@fische/react
v0.0.3
Published
React Hooks for utility
Maintainers
Readme
fische
React Utility Custom Hook Package
npm install fische
yarn add fische
pnpm add fischeuseBooleanState
- A useState hook for using boolean state conveniently
- example
const [display, show, hide, toggle] = useBooleanState(initialState) - If
initialStateis not provided as an argument, the default state value is set to false. - DOCS
useConditionalRender
- A React hook for using conditional render easily
- useful in triggering animation with (un)mounting component
- DOCS
useDebouncedEffect / State / Fn
- A React hook for debounced effect/state
- DOCS
useForceRender
- A React hook for forcibly rendering a component
- DOCS
useIsomorphicLayoutEffect
- In an SSR environment, useEffect should be used, while on the client side, useLayoutEffect should be utilized.
- helps prevent hydration errors
- DOCS
useMediaQuery
- A React hook for using MediaQuery easily
- DOCS
useRefEffect
- A React hook for give effect to Ref values
- DOCS
useTextCopy
- A React hook for copying plain text to clipboard
- other types will be provided later
- works only in localhost or https
- DOCS
