A collection of reusable custom React hooks built by Ashish Sharma.
//---------------------------------------------------------------------------------------
Can simply create a new-file of hook in your directory to start importing defaults.
//---------------------------------------------------------------------------------------
// const debouncedValue = useDebounce(value, delay);
// @param value: any → the value to debounce // @param delay: number → debounce delay in ms (default: 500) // @returns debouncedValue: any
// const [value, setValue] = useLocalStorage(key, initialValue);
// @param key: string → the key used in localStorage // @param initialValue: any → fallback if no stored value exists // @returns value: any → current state value // setValue: func → setter that also updates localStorage
// useDocumentTitle(title);
// @param title: string → title to set on the document/tab // @returns void
// useFavicon(url);
// @param url: string → URL or path to the favicon image // @returns void
// const [copyToClipboard, isCopied] = useCopyToClipboard();
// @returns copyToClipboard: func → function to copy text to clipboard // isCopied: boolean → indicates if copy was successful recently
// const clear = useInterval(cb, ms);
// @param cb: function → function to run on interval // @param ms: number → interval delay in milliseconds // @returns clear: function → call this to manually clear the interval