Skip to content

About

React Hooks Library

Resources

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

 

History

1 Commit

Folders and files

Repository files navigation

React Custom Hooks Library

A collection of reusable custom React hooks built by Ashish Sharma.

//---------------------------------------------------------------------------------------

Usage

Can simply create a new-file of hook in your directory to start importing defaults.

//---------------------------------------------------------------------------------------

Available Hooks

✅ useDebounce

// const debouncedValue = useDebounce(value, delay);

// @param value: any → the value to debounce // @param delay: number → debounce delay in ms (default: 500) // @returns debouncedValue: any

✅ useLocalStorage

// 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

// useDocumentTitle(title);

// @param title: string → title to set on the document/tab // @returns void

✅ useFavicon

// useFavicon(url);

// @param url: string → URL or path to the favicon image // @returns void

✅ useCopyToClipboard

// const [copyToClipboard, isCopied] = useCopyToClipboard();

// @returns copyToClipboard: func → function to copy text to clipboard // isCopied: boolean → indicates if copy was successful recently

// ✅ useInterval

// 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

About

React Hooks Library

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages