I heard many things about writing React applications with Redux or without (props + contexts).
People advise to do not use Redux if the application is small.
When I was checking Facebook with the React DevTools inspector, I have noticed that they use a lot of Providers inside.
What has better performance? And what I should use?
Redux uses Context API inside to share state across components.
But Redux does it in a smarter way.
Contexts accessing in child components to read some value is fast, context value modifications are slow. So Redux creates some context hooks inside components just to have access to them (context value reading only) and forces components rerendering and data updates in its own way.
Using Redux we are sure the rerendering occurs only in child components that need it.
If you know how to use Context API in a smart way, or your application is really small, you can use contexts.
Hint: consider using
memo()too, to force rerendering only components that hook contexts.