← React Intermediate Questions - Set 4 Q40

How do you handle component state in a Redux store?

React Intermediate Questions - Set 4

Example

// Redux: component state lives in the store, not in the component
const items = useSelector(s => s.cart.items);
dispatch({ type: 'cart/add', payload: item });

What to notice

← Back to the question list