Thanks for sharing!
Could you explain the difference between stores and providers and the reason why providers is in utils folder and stores in root separately?
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.
Thanks for sharing!
Could you explain the difference between
stores
andproviders
and the reason whyproviders
is inutils
folder andstores
inroot
separately?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 whileproviders
are mostly used for some specific pages.Thank you! Your explanation was very helpful to understand!