diff --git a/react-state/8.1.md b/react-state/8.1.md index cdd6559..3b48584 100644 --- a/react-state/8.1.md +++ b/react-state/8.1.md @@ -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: diff --git a/react-state/8.2.md b/react-state/8.2.md index 634c664..b068160 100644 --- a/react-state/8.2.md +++ b/react-state/8.2.md @@ -8,4 +8,4 @@ In the code example below I am creating a `` that demonstrates Note that the `` 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 `` 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 `` 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.