リファレンス
フック
- useAsyncEffect —
useAsyncEffectis a React hook for handling asynchronous side effects in React components. - useAvoidKeyboard —
useAvoidKeyboardis a React hook that helps fixed-bottom elements avoid the on-screen keyboard. - useBodyScrollLock —
useBodyScrollLockis a React hook that locks body scroll while the component is mounted. - useBooleanState —
useBooleanStateis a React hook that simplifies managing a boolean state. - useCallbackOncePerRender —
useCallbackOncePerRenderis a React hook that ensures a callback function is executed only once, regardless of how many times it's called. - useConditionalEffect —
useConditionalEffectis a React hook that conditionally executes effects based on a predicate function. - useControlledState —
useControlledStateis a React hook that allows you to control both controlled and uncontrolled states. - useCounter —
useCounteris a React hook that manages a numeric counter state with increment, decrement, and reset capabilities. - useDebounce —
useDebounceis a React hook that returns a debounced version of the provided callback function. - useDebouncedCallback —
useDebouncedCallbackis a React hook that returns a debounced version of the provided callback function. - useDebouncedValue —
useDebouncedValueis a React hook that returns a debounced copy of the given value. - useDoubleClick —
useDoubleClickis a React hook that differentiates between single and double click events. - useGeolocation —
useGeolocationis a React hook that retrieves and tracks the user's geographical location. - useImpressionRef —
useImpressionRefis a React hook that measures the time a specific DOM element is visible on the screen and executes callbacks when the element enters or exits the viewport. - useInputState —
useInputStateis a React hook that manages an input state with optional value transformation. - useIntersectionObserver —
useIntersectionObserveris a React hook that detects whether a specific DOM element is visible on the screen. - useInterval —
useIntervalis a React hook that executes a function at a specified interval. - useIsClient —
useIsClientis a React hook that returnstrueonly in the client-side environment. - useIsomorphicLayoutEffect —
useIsomorphicLayoutEffectis a React hook that provides the behavior ofuseLayoutEffectwithout triggering warnings during server-side rendering. - useKeyboardHeight —
useKeyboardHeightis a React hook that tracks the on-screen keyboard height. - useList — A React hook that manages an array as state.
- useLoading —
useLoadingis a React hook that simplifies managing the loading state of aPromise. - useLongPress —
useLongPressis a React hook that detects when an element is pressed and held for a specified duration. - useMap — A React hook that manages a key-value Map as state.
- useNetworkStatus —
useNetworkStatusis a React hook that provides access to the Network Information API. - useOutsideClickEffect —
useOutsideClickEffectis a React hook that triggers a callback when a click event occurs outside the specified container(s). - usePageVisibility —
usePageVisibilityis a React hook that detects page visibility changes. - usePreservedCallback —
usePreservedCallbackis a React hook that maintains a stable reference to a callback function while ensuring it always has access to the latest state or props. - usePreservedReference —
usePreservedReferenceis a React hook that helps maintain the reference of a value when it hasn't changed, while ensuring you can safely use the latest state. - usePrevious —
usePreviousis a React hook that returns the previous value of the input state. - useRefEffect —
useRefEffectis a React hook that helps you set a reference to a specific DOM element and execute a callback whenever the element changes. - useSafeAreaInset —
useSafeAreaInsetis a React hook that tracks safe area inset changes. - useScrollDirection —
useScrollDirectionis a React hook that detects scroll direction. - useSet — A React hook that manages a Set as state.
- useStorageState —
useStorageStateis a React that functions likeuseStatebut persists the state value in browser storage. - useThrottle —
useThrottleis a React hook that creates a throttled version of a callback function. - useThrottledCallback —
useThrottledCallbackis a React hook that returns a throttled version of the provided callback function. - useThrottledValue —
useThrottledValueis a React hook that returns a throttled copy of the given value. - useTimeout —
useTimeoutis a React hook that executes a callback function after a specified delay. - useToggle —
useToggleis a React hook that simplifies managing a boolean state. - useVisibilityEvent —
useVisibilityEventis a React hook that listens to changes in the document's visibility state and triggers a callback. - useVisualViewport —
useVisualViewportis a React hook that tracks Visual Viewport changes.
コンポーネント
- ImpressionArea —
ImpressionAreais a component that measures the time a specific DOM element is visible on the screen and executes callbacks when the element enters or exits the viewport. - Separated —
Separatedis a component that inserts a specified component between each child element. - SwitchCase —
SwitchCaseis a component that allows you to declaratively render components based on a given value, similar to aswitch-casestatement.
ユーティリティ
- buildContext —
buildContextis a helper function that reduces repetitive code when defining React Context. - disableBodyScrollLock —
disableBodyScrollLockis a utility function that unlocks the body scroll. - enableBodyScrollLock —
enableBodyScrollLockis a utility function that locks the body scroll. - getKeyboardHeight —
getKeyboardHeightis a utility function that returns the current on-screen keyboard height in pixels. - getSafeAreaInset —
getSafeAreaInsetis a utility function that returns all safe area insets in pixels as an object. - isAndroid —
isAndroidis a utility function that detects whether the current device is running Android. - isIOS —
isIOSis a utility function that detects whether the current device is running iOS or iPadOS. - isKeyboardVisible —
isKeyboardVisibleis a utility function that checks whether the on-screen keyboard is currently visible. - isServer —
isServeris a utility function that checks if the code is running on the server. - mergeProps —
mergePropsis a utility function that merges multiple props objects into a single object. - mergeRefs — This function takes multiple refs (RefObject or RefCallback) and returns a single ref that updates all provided refs.
- subscribeKeyboardHeight —
subscribeKeyboardHeightis a utility function that subscribes to changes in the on-screen keyboard height.