DEV Community

Discussion on: How I structure my React projects

Collapse
 
larswaechter profile image
Lars Wächter • Edited

stores are global states across the whole application managed by zustand, which is a state-management library.

providers are actually React Context providers. I use them mostly to make the state management for "large" pages with a deep component tree easier. I guess you could also put them into the directory of the according "page" component.

So stores are accessible from anywhere within the application while providers are mostly used for some specific pages.

Collapse
 
dotorimook profile image
dotorimook

Thank you! Your explanation was very helpful to understand!