RTK for the useReducer Hook: A Guideby@anatolii
392 reads

RTK for the useReducer Hook: A Guide

tldt arrow
Read on Terminal Reader
Read this story w/o Javascript

Too Long; Didn't Read

Hook is a way to keep and manage data in the store for the particular component and its children. Hook will return the State and functions to change the state. Hook then will have a standard switch-case implementation; I wrapped it with `produce` function from the Immer lib. It’s to avoid mistakes while coping in full state. But yeah, in the very original reducer where the object of the state is without multiple nested objects, I will only use the spread operator.

People Mentioned

Mention Thumbnail

Companies Mentioned

Mention Thumbnail
Mention Thumbnail
featured image - RTK for the useReducer Hook: A Guide
Anatolii Kabanov HackerNoon profile picture

@anatolii

Anatolii Kabanov


Receive Stories from @anatolii

react to story with heart

RELATED STORIES

L O A D I N G
. . . comments & more!
Hackernoon hq - po box 2206, edwards, colorado 81632, usa