Skip to content Skip to sidebar Skip to footer

React Usecontext() Performance, Usecontext Inside Custom Hook

I used a structure using React Hooks. It is based on a global Context that contains a combination of reducers (as in the Redux). Also, I widely use custom hooks to separate logic.

Solution 1:

Internally, hooks can reference a state queue owned by component. (Under the hood of React’s hooks system - Eytan Manor )

useContext is just to reference a global state from the relative Context Provider. There is almost no overhead from useContext as you are concerned.

Post a Comment for "React Usecontext() Performance, Usecontext Inside Custom Hook"