I'm developing a React + Meteor app.
I have a route that accepts a parameter for example to show the single page of a document, so the route accepts an ID parameter. Then the route forwards the request to:
createContainer component that gets the data from collection (based on id) and return the document to a child component
child component displays data
Now, in my child component, I want to setup state in the constructor based on the value from the data (document), but the value of the data is stil undefined in the constructor, is this normal (still loading)? How can I setup state based on value of data?
Yes, it's normal.
You need to look at componentWillReceiveProps(). Compare
this.props and set the state.