Last active
August 29, 2015 14:16
-
-
Save shrunyan/c129fcf66d9762ab6a39 to your computer and use it in GitHub Desktop.
Explanation of `props` vs. `state` in react.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
"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