Joel Watson

Joel.Watson92@gmail.com | LinkedIn: /in/joel3rbear | Twitter: @Joel3rBear


Project maintained by JoelMWatson Hosted on GitHub Pages — Theme by mattgraham

Home » Reading Notes » Custom Hooks


Class 27 Reading: Custom Hooks

Why do custom hooks need the “use” prefix?

Custom hooks need to have the “use” prefix because it allows react to recognize that this function is actually a custom hook and can return stateful variables.

What do custom hooks usually do?

Custom hooks allow you to modularize your code much further than state components. It is especially useful for separating business logic from UI logic.

The useFormState hook from the react-use-form-state package seems interesting. It looks like it drastically reduces the code necessary to process form data.