React’s context works great for global state that changes rarely


React’s context works great for global state that changes rarely.

But there are many alternatives that may be preferable depending on use case:

Third party libraries:
Jotai
Zustand
React Query
swr
RTK Query
Redux
Apollo

The web platform:
localStorage
sessionStorage
IndexDb
Cookie
URL

Pattern:
Compose children to eliminate prop drilling

View original on X