4 ms·
People use context as a global data store which is fine if you limit global data to "things that a lot of components need to read, but very few get to write to"
by schwartzworld 4y ago
People use context as a global data store which is fine if you limit global data to "things that a lot of components need to read, but very few get to write to" which is what it should be. Dark mode preferences are the canonical example.
Global state is the road to insanity in ant react app. Prefer props in all cases.