Skip to content

Instantly share code, notes, and snippets.

@shrunyan
Last active August 29, 2015 14:16
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save shrunyan/c129fcf66d9762ab6a39 to your computer and use it in GitHub Desktop.
Save shrunyan/c129fcf66d9762ab6a39 to your computer and use it in GitHub Desktop.
Explanation of `props` vs. `state` in react.
"The difference between the two is how they change. `props` can be thought of as the input
from the outside world. It’s set from the parameters your component is called with, and
its values should be treated as immutable. `State`, on the other hand, is the data that’s
owned by your component. You update it via the `setState` method, and no one else should
be changing it on you."
-- http://www.crashlytics.com/blog/building-user-interfaces-with-react/
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment