-
Sensors
useBattery
β tracks device battery state.useGeolocation
β tracks geo location and permission state of user's device.useNetworkState
β tracks the state of apps network connection.useAccelerometer
,useUserAccelerometer
,useGyroscope
, anduseMagnetometer
β tracks accelerometer, gyroscope, and magnetometer sensors state of user's device.useOrientation
β tracks state of device's screen orientation.useOrientationFn
β calls given function changed screen orientation of user's device.
-
UI
useAudio
β plays audio and exposes its controls.useAssetVideo
anduseNetworkVideo
β plays video, tracks its state, and exposes playback controls.
-
Animations
useInterval
β re-builds component on a set interval usingTimer.periodic
.useTimeout
β re-builds component after a timeout.useTimeoutFn
β calls given function after a timeout.useUpdate
β returns a callback, which re-builds component when called.
-
Side-effects
useFutureRetry
βuseFuture
with an additional retry method.useDebounce
β debounces a function.useError
β error dispatcher.useException
β exception dispatcher.
-
Lifecycles
useEffectOnce
β a modifieduseEffect
hook that only runs once.useLifecycles
β callsmount
andunmount
callbacks.useLogger
β logs in console as component goes through life-cycles.useMount
β callsmount
callbacks.useUnmount
β callsunmount
callbacks.useUpdateEffect
β run aneffect
only on updates.useCustomCompareEffect
β run aneffect
depending on deep comparison of its dependencies.
-
State
useDefault
β returns the default value when state isnull
.useLatest
β returns the latest state or props.usePreviousDistinct
β likeusePrevious
but with a predicate to determine ifprevious
should update.useStateList
β circularly iterates over an array.useToggle
anduseBoolean
β tracks state of a boolean.useCounter
anduseNumber
β tracks state of a number.useList
β tracks state of an array.useMap
β tracks state of a map.useSet
β tracks state of a Set.useTextFormValidator
β tracks state of an object.useFirstMountState
β check if current build is first.useBuildsCount
β count component builds.
-
TBD
useCopyToClipboard
β copies text to clipboard.useEvent
β subscribe to events.useScroll
β tracks a widget's scroll position.useScrolling
β tracks whether widget is scrolling.useFullscreen
β display an element or video full-screen.useClickAway
β triggers callback when user clicks outside target area.usePageLeave
β triggers when mouse leaves page boundaries.usePermission
β query permission status for apps APIs.useMethods
β neat alternative touseReducer
.useSetState
β createssetState
method which works likethis.setState
.usePromise
β resolves promise only while component is mounted.useObservable
β tracks latest value of anObservable
.useThrottle
anduseThrottleFn
β throttles a function.
Unlicense β public domain.