Skip to content

Commit

Permalink
updates
Browse files Browse the repository at this point in the history
  • Loading branch information
codylindley committed Aug 30, 2016
1 parent 38f52b1 commit 433b44e
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion react-state/8.1.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# What Is Component State?

Most components should simply take in props and render. But, components also offer state, and it is used to store information about the component that can change over time. Typically the change comes as a result of user events or system events (i.e., as a response to user input, a server request or the passage of time).
Most components should simply take in props and render. But, components also offer state, and it is used to store information about the component that can change over time. Typically the change comes as a result of user events or system events (i.e., as a response to user input, a server request, or the passage of time).

According to the React documentation state should:

Expand Down
2 changes: 1 addition & 1 deletion react-state/8.2.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,4 @@ In the code example below I am creating a `<MoodComponent />` that demonstrates
Note that the `<MoodComponent />` has an initial state of ':|', that is set using `getInitialState: function() {return {mood: ':|'};}`, which is used in the component when it is first rendered by writing, `{this.state.mood}`.

To change the state, an event listener is added; in this case a click event (i.e., `onChange`) on the `<span>` node that will call the `changeMood` function. Within this function I use `this.setState()` to cycle to the next mood based on the current mood/state. After the state is update (i.e., `setState()` merges the changes) the component will re-render itself and the UI will change.
To change the state, an event listener is added; in this case a click event (i.e., `onClick`) on the `<span>` node that will call the `changeMood` function. Within this function I use `this.setState()` to cycle to the next mood based on the current mood/state. After the state is update (i.e., `setState()` merges the changes) the component will re-render itself and the UI will change.

0 comments on commit 433b44e

Please sign in to comment.