Skip to content
๐Ÿ‘ฉโ€๐Ÿณ A React Hooks utility library containing popular customized hooks
JavaScript
Branch: master
Clone or download
Latest commit 38292e7 Jan 15, 2020

README.md

react-recipes-logo

React Recipes

A React Hooks utility library containing popular customized hooks

What's your favorite dish?

Build Status

npm i react-recipes --save
yarn add react-recipes

๐Ÿฅ˜ Recipes Documentation

Name Returns Arguments
๐Ÿช useCookie [cookieValue, updateCookie, deleteCookie] (cookieName, initialValue)
๐Ÿฅ  useCopyClipboard [isCopied, setIsCopied] (duration: 2000)
๐Ÿฉ useDarkMode [enabled, setEnabledState] -
๐Ÿœ useDebounce debouncedValue (value, delay)
๐Ÿฅก useDimensions [ref, dimensions, node] (liveMeasure: true, delay: 250, initialDimensions: {}, effectDependencies: [])
๐Ÿณ useEventListener - (eventName, handle, element: window)
๐ŸŒฏ useGeolocation { latitude, longitude, timestamp, accuracy, error } (watch: false, settings: {enableHighAccuracy: false, timeout: Infinity, maximumAge: 0})
๐ŸŒญ useHover [callbackRef, value] -
๐Ÿฆ useInterval - (callback, delay, runOnLoad: false, effectDependencies: [])
๐Ÿ useIsClient isClient -
๐Ÿฅง useKeyPress keyPressed (targetKey)
๐Ÿฑ useLocalStorage [storedValue, setValue] (key, initialValue)
๐Ÿ‹ useLockBodyScroll - -
๐Ÿ‰ useMedia value (queries, values, defaultValue)
๐Ÿฅญ useMultiKeyPress keysPressed (targetKey)
๐Ÿฅ‘ useOnClickOutside - (ref, callback)
๐Ÿฅ’ useOnlineStatus onlineStatus -
๐Ÿฟ usePrevious previous (value)
๐Ÿฃ useScript [loaded, error] (src)
๐Ÿ– useSpeechRecognition { supported, listen, listening, stop } ({ onEnd })
๐Ÿ— useSpeechSynthesis { supported, speak, speaking, cancel, voices } ({ onEnd, onResult })
๐Ÿ useThrottle throttledValue (value, ms: 250)
๐Ÿท useWhyDidYouUpdate - (name, props)
๐Ÿฅ– useWindowScroll { x, y } -
๐Ÿฅฎ useWindowSize { height, width } (initialWidth, initialHeight)
๐Ÿฅ useWorker worker instance (scriptPath, workerOptions, attributes)
You canโ€™t perform that action at this time.