Thank you! Really appreciate! :)
The Context API can be a performance bottleneck if used in the wrong way.
If you wrap your component and use a consumer only it really need to be used, you "solve" prop drilling and re-render only the necessary parts of the component (components that directly use the provider value).
You need to always be careful when implementing a context api driven component and keep track of the re-renders in your component. Other state management libraries could be a better choice for more complex cases.
Great job!
Thanks for sharing!
Does Context better in your case in terms of performance ?
Thank you! Really appreciate! :)
The Context API can be a performance bottleneck if used in the wrong way.
If you wrap your component and use a consumer only it really need to be used, you "solve" prop drilling and re-render only the necessary parts of the component (components that directly use the provider value).
You need to always be careful when implementing a context api driven component and keep track of the re-renders in your component. Other state management libraries could be a better choice for more complex cases.
Thanks for explanation. Appreciate it