React·100 questions

What is a selector and why is it important for performance?

Answer
Selector selects a part of the state.
Reduces re-renders if the component subscribes only to what it needs.
In Redux — reselect/memoized selectors.
In Zustand — selector in useStore.
Selectors help keep components narrow.
Was this answer helpful?

More questions in this topic

Related questions from other topics