On a first-time Meteor project and want to use React for my view layer. I’m pretty familiar with Redux and creating React containers with them and am seeing a very similar pattern using react-meteor-data
. My question is if I want to maintain a client-side only global store object for UI state using Redux, what’s the best way to create React containers that receive both Meteor data and the Redux store?
The pattern I’ve come up with is as follows – assume a ‘campaigns’ collection:
-
CampaignsDataContainer
- subscribes to ‘campaigns’ and exports
this.props.campaigns
- outputs a
CampaignsUIContainer
and passes thecampaigns
props
- subscribes to ‘campaigns’ and exports
-
CampaignsUIContainer
- connects with
react-redux
for UI state data - outputs dumb components, passing meteor data and UI data/dispatches as needed
- connects with
Does this make sense, are there any performance concerns, or is there a way to combine the containers, or some library out there that has a better solution?