4 ms·
React state is a hot mess, yes! We kept the same interface as the Svelte store, but with different semantics: - special management of undefined values - e
by hbbio 3y ago
React state is a hot mess, yes!
We kept the same interface as the Svelte store, but with different semantics:
- special management of undefined values
- error management
- promise management
- bavell 3y agoCurious - what makes react state a mess? Is it just that there's not much batteries included?
- pcthrowaway 3y agoBriefly speaking, it's because the mechanisms for dealing with complex state structures which are either global, or shared between multiple components which are not direct ancestors/ descendents of one another, are really complicated, due to how changes within that state need to be managed and propagated through the component dependency graph. Spend an hour, a day, or a year (depending on how broad you want your "introduction" to this topic to be) reading the various blogs and docs on state management systems if you want to see how crazy this gets.