Gathering detailed insights and metrics for react-use-native
Gathering detailed insights and metrics for react-use-native
Gathering detailed insights and metrics for react-use-native
Gathering detailed insights and metrics for react-use-native
npm install react-use-native
Module System
Min. Node Version
Typescript Support
Node Version
NPM Version
2 Stars
2,987 Commits
2 Branches
1 Contributors
Updated on 09 Jun 2024
TypeScript (99.62%)
JavaScript (0.38%)
Cumulative downloads
Total Downloads
Last day
1,766.7%
112
Compared to previous day
Last week
12.2%
367
Compared to previous week
Last month
-10.6%
1,800
Compared to previous month
Last year
348%
27,469
Compared to previous year
1
45
libreact
.
npm i react-use-native
useRaf
— re-renders component on each requestAnimationFrame
.useInterval
— re-renders component on a set interval using setInterval
.useTimeout
— re-renders component after a timeout.useTimeoutFn
— calls given function after a timeout. useUpdate
— returns a callback, which re-renders component when called.
useAsync
, useAsyncFn
, and useAsyncRetry
— resolves an async
function.useDebounce
— debounces a function. useError
— error dispatcher. useRafLoop
— calls given function inside the RAF loop.useThrottle
and useThrottleFn
— throttles a function.
useEffectOnce
— a modified useEffect
hook that only runs once.useLifecycles
— calls mount
and unmount
callbacks.useMountedState
and useUnmountPromise
— track if component is mounted.usePromise
— resolves promise only while component is mounted.useLogger
— logs in console as component goes through life-cycles.useMount
— calls mount
callbacks.useUnmount
— calls unmount
callbacks.useUpdateEffect
— run an effect
only on updates.useIsomorphicLayoutEffect
— useLayoutEffect
that that works on server.useDeepCompareEffect
, useShallowCompareEffect
, and useCustomCompareEffect
createMemo
— factory of memoized hooks.createReducer
— factory of reducer hooks with custom middleware.createReducerContext
and createStateContext
— factory of hooks for a sharing state between components.useDefault
— returns the default value when state is null
or undefined
.useGetSet
— returns state getter get()
instead of raw state.useGetSetState
— as if useGetSet
and useSetState
had a baby.useLatest
— returns the latest state or propsusePrevious
— returns the previous state or props. usePreviousDistinct
— like usePrevious
but with a predicate to determine if previous
should update.useObservable
— tracks latest value of an Observable
.useRafState
— creates setState
method which only updates after requestAnimationFrame
. useSetState
— creates setState
method which works like this.setState
. useStateList
— circularly iterates over an array. useToggle
and useBoolean
— tracks state of a boolean. useCounter
and useNumber
— tracks state of a number. useList
useUpsert
useMap
— tracks state of an object. useSet
— tracks state of a Set. useQueue
— implements simple queue.useStateValidator
— tracks state of an object. useStateWithHistory
— stores previous state values and provides handles to travel through them. useMultiStateValidator
— alike the useStateValidator
, but tracks multiple states at a time. useMediatedState
— like the regular useState
but with mediation by custom function. useFirstMountState
— check if current render is first. useRendersCount
— count component renders. createGlobalState
— cross component shared state.useMethods
— neat alternative to useReducer
.
useEnsuredForwardedRef
and ensuredForwardRef
— use a React.forwardedRef safely.
Usage — how to import.
Unlicense — public domain.
Support — add yourself to backer list below.
No vulnerabilities found.
No security vulnerabilities found.