COMPRESSEDfm cover image

47 | Brain Dump on React Hooks

COMPRESSEDfm

00:00

Redux and the Use Reducer Hook

The use reducer hook, which is basically a redux hook, lets you pass in an initial state and then it will return to you. So any time somebody clicks the increment button or they submit the form, now you call it dispatch,. You pass in the appropriate action, and then the reducer takes over to figure out based on that on type, here's what i should do, up date the state accordingly. I would say for most getting started things, it's probably a little bit of overkill. In smaller applications to use, it does give a clean framework for how you manage state. And it does, i think, become really useful when you do have a complicated number

Transcript
Play full episode

The AI-powered Podcast Player

Save insights by tapping your headphones, chat with episodes, discover the best highlights - and more!
App store bannerPlay store banner
Get the app