To use Meteor data in a React component, the documents mention wrapping your root <App />
component using the following:
App.propTypes = {
currentUser: PropTypes.object,
};
export default createContainer(() => {
return {
currentUser: Meteor.user(),
};
}, App);
I have 2 questions:
- Can you wrap only your root
<App/>
container and use Meteor data in child components directly? If not directly, I assume passing data through props is the norm. Is this the preferred style used when structuring your application? - Is it possible (or preferred) to separately wrap EVERY component that might need Meteor data (such as
Meteor.user()
)? Is doing this preferred instead?