Custom Hooks for React
This is a collection of custom hooks for React.
Hooks List in this repo
- useFetch - Fetch data from an API
- useLocalStorage - Save data to local storage and retrieve it
- useSessionStorage - Save data to session storage and retrieve it
- useTitle - Change the title of the page
- useToggle - Toggle between two values
- useDarkMode - Toggle between light and dark mode
- useWindowSize - Get the size of the window
Activly i am working on these hooks and will add more hooks in future.
How to use these hooks
- Clone this repo
- Copy the hook you want to use
- Paste it in your project
- Import the hook in your component
- Use the hook
How to contribute
- Fork this repo
- Clone the forked repo
- Create a new branch
- Add your hook
- Push the changes
- Create a pull request
- i will review the changes and merge them
How to run this project
- Clone this repo
- Run
npm install
to install the dependencies - Run
npm start
to start the project
CodingWithRasla
Thanks for visiting this repo. If you like this repo, please give it a star. Checkout my youtube Channel for more content.License
MIT © Rasla