mercredi 12 février 2020

modelling reusable react components with state stored in redux

This is a software design / architecture question:

I want to model a component in react, who's state is stored in redux, but I want to be able to make multiple instances of that component. The best I can come up with is to encapsulate all the properties for the component in an object and then shove that object into an array, using an id field or index to get the component you are looking for but I'm not sure if this is the best approach. Is there a 'standard' or industry best practice way to go about this?

Aucun commentaire:

Enregistrer un commentaire