4 ms·
> I'm not sure why you think the data is irrelevant I believe the GP meant "unrelated". Can you drop your top level component into another application with dif
by pault 8y ago
> I'm not sure why you think the data is irrelevant
I believe the GP meant "unrelated". Can you drop your top level component into another application with different children and still have it work? Can you move the child components to another view tree and still have them work? It seems like what you are describing is a top level component that is tightly coupled to its descendants with too many responsibilities. In the ideal react app architecture you should be able to take any component and move it anywhere else in the app and it should Just Work. This is the problem redux is supposed to solve, and I would argue that by enforcing an explicit pattern that most experienced react developers know, you will get closer to that ideal than if you have a variety of home grown solutions that vary from project to project (and even from developer to developer on the same project). "The Tyranny of Structurelessness" etc etc.
- kerkeslager 8y ago> Can you drop your top level component into another application with different children and still have it work? Yes, it's a matter of passing the child into the parent as a prop. > Can you move the child components to another view tree and still have them work? Yes, this sort of thing is exactly what you get for free by doing things the way I describe. > In the ideal react app architecture you should be able to take any component and move it anywhere else in the app and it should Just Work. This is exactly not what happens in Redux projects in my experience.
- pault 8y ago> This is exactly not what happens in Redux projects in my experience. Sorry to beat this dead horse, but how does redux, which binds data directly at the level of the component that displays the data, make portable components more difficult than vanilla react where stateful components and functional components are tightly coupled? Do you have links to a gist or something so I can see what you're describing?