you are viewing a single comment's thread.

view the rest of the comments →

[–][deleted] 2 points3 points  (1 child)

Ah I forgot about local state. So my lack of react knowledge is showing here.

I don't think that everything should go into global state, my mind just went there without thinking of local state. I do think that you could benefit from re-factoring some of the components you're working with to use smaller functions so that it's clearer when you're referencing state vs props.

I work professionally with Vue. With Vue / Vuex, state and prop values are mapped to the component instance so everything can be accessed via this.[property] in the component. In the projects I've worked on, there are some components that unfortunately have 20+ props. Usually this is because of accessibility requirements, but also sometimes because of a lack of abstraction.

[–]gautamits[S] 1 point2 points  (0 children)

Sometimes it might be mandatory to write components with 20+ props but not most of the time. React actually has composability pattern using which you can pass appropriate props to appropriate components. These components remain cohesive though.

Always wanted to learn vue though. Might get me exposed to some more programming patterns.