- Mutate State only using the provided methods. (e.g. setState())
- In the render method retrieve properties with "this.state.varname"
https://facebook.github.io/react/docs/component-api.html
To ponder further:
"Often, it becomes clear that the proper place to "own" that state is at a higher level in the hierarchy. Placing the state there often eliminates any desire to use
And data flow is well described here:
https://github.com/facebook/flux
- Refs to include any child components as "state"
- Warned "By default, use the Reactive data flow and save
ref
s for use cases that are inherently non-reactive"
To ponder further:
"Often, it becomes clear that the proper place to "own" that state is at a higher level in the hierarchy. Placing the state there often eliminates any desire to use
ref
s to "make things happen" – instead, the data flow will usually accomplish your goal."And data flow is well described here:
https://github.com/facebook/flux
No comments:
Post a Comment