Browse Source
[Documentation] [Main concepts: State and Lifecycle] (#2981)
Co-authored-by: R Nabors <rachelnabors@users.noreply.github.com>
main
Siju Samson
5 years ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with
0 additions and
6 deletions
-
content/docs/state-and-lifecycle.md
|
@ -417,12 +417,6 @@ This is why state is often called local or encapsulated. It is not accessible to |
|
|
|
|
|
|
|
|
A component may choose to pass its state down as props to its child components: |
|
|
A component may choose to pass its state down as props to its child components: |
|
|
|
|
|
|
|
|
```js |
|
|
|
|
|
<h2>It is {this.state.date.toLocaleTimeString()}.</h2> |
|
|
|
|
|
``` |
|
|
|
|
|
|
|
|
|
|
|
This also works for user-defined components: |
|
|
|
|
|
|
|
|
|
|
|
```js |
|
|
```js |
|
|
<FormattedDate date={this.state.date} /> |
|
|
<FormattedDate date={this.state.date} /> |
|
|
``` |
|
|
``` |
|
|