3 ms·
Exactly! I don't know the right solution, either. All the tutorials I've read don't seem to know, either. They're either too simple to where that doesn't become
by FinalBriefing 4y ago
Exactly! I don't know the right solution, either. All the tutorials I've read don't seem to know, either. They're either too simple to where that doesn't become an issue, or they do what you do, and it looks like a mess to me.
In Vue, I'll usually create a service to handle local-yet-shared state (which is just Vanilla JS, no Vue constructs), or create a VueX module (which you could use in React, as well). It's much easier to follow than React's wrapper methods.
In my experience, in both React and Angular, a lot of the things I expect a framework to handle need to be managed by the developer (namely, keeping shared values in sync). Over time, patterns can deviate to where different components/modules use different patterns, and devs spend extra time reading through component files to figure out why their feature isn't updating as expected.