Assign reactive data from createContainer to component's state


#1

Hi guys, so using createContainer is the standard method for retrieving reactive data from Meteor’s Collections, this data is received by the component as props. Is some cases, however, this data that comes from the database needs to be modified inside this component and sent back to the database, for that it would be better to have this data in the component’s state. Is it anti-pattern to assign the received props to the component’s state inside a componentWillReceiveProps call?


#2

No. I think that’s pretty reasonable!


#3

Is it ok to use that approach even when you don’t really need to modify your props? Sometimes it would just be more appropriate to have data in the Component’s state.


#4

Props are the main way components are supposed to receive external input I think.