4 ms·
I think it sounds like your data model is a bit too coupled to your component tree. Try and figure out what the minimal information you need to store is, and k
by glenjamin 10y ago
I think it sounds like your data model is a bit too coupled to your component tree.
Try and figure out what the minimal information you need to store is, and keep that higher up.
You can then derive a richer model by applying functions during render().
There's a balance to be found here, if you design your data model without considering the needs of the UI it can be a pain to work with.
The goal is to create a data layer and associated functions which make it easy to extract the appropriate information for rendering a user interface.
Often pain points in React can be alleviated by modelling your data more independently of your component tree.