5 ways that will change how you write React hooks

An Effect has no Name

Writing several effects in the same component?

Async Functions

Effects don’t support async functions (you can’t return a promise).
It’s so annoying, let’s try to solve it:

Debouncing the Hooks Way

It’s really stupid to implement your own debounce when there is a ton of libraries out there who already have. Right?!

useCallbacks? Nahhh….

You might think that `useReducer` is better than `useState` when managing a complex object:

Use `useContext` with selectors to bail out of render

You’ve probably heard many times that it’s impossible to bail out of rendering if you’re using Context.

Hope you learned something new! Tell your friends.

--

--

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store