Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit 9fdbd9d

Browse files
rchrdchnpozymasika
authored andcommitted
Fixing typos
updated _it's_ when it should be _its_
1 parent 14bf67a commit 9fdbd9d

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

‎day-06/post.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,11 +22,11 @@ We've almost made it through the first week of getting up and running on React.
2222

2323
React does _not_ allow us to modify `this.props` on our components for good reason. Imagine if we passed in the `title` prop to the `Header` component and the `Header` component was able to modify it. How do we know what the `title` is of the `Header` component? We set ourselves up for race-conditions, confusing data state, and it would be an all-around bad idea to modify a variable passed to a child component by a parent component.
2424

25-
However, sometimes a component needs to be able to update it's own state. For example, setting an `active` flag if a child component needs to show it's selected or updating a timer on a stopwatch, for example.
25+
However, sometimes a component needs to be able to update its own state. For example, setting an `active` flag or updating a timer on a stopwatch, for instance.
2626

2727
While it's preferable to use `props` as much as we can, sometimes we need to hold on to the state of a component. To handle this, React gives us the ability to hold _state_ in our components.
2828

29-
`state` in a component is intended to be completely internal to the Component and it's children (i.e. accessed by the component and any children it used). Similar to how we access `props` in a component, the state can be accessed via `this.state` in a component. Whenever the state changes (via the `this.setState()` function), the component will rerender.
29+
`state` in a component is intended to be completely internal to the Component and its children (i.e. accessed by the component and any children it used). Similar to how we access `props` in a component, the state can be accessed via `this.state` in a component. Whenever the state changes (via the `this.setState()` function), the component will rerender.
3030

3131
For instance, let's say we have a simple clock component that shows the current time:
3232

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /