Files
2018-10-16 21:32:40 +05:30

34 lines
907 B
Markdown
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

---
title: Render State in the User Interface
localeTitle: Состояние визуализации в пользовательском интерфейсе
---
## Состояние визуализации в пользовательском интерфейсе
В этом случае вам нужно будет отобразить значение состояния в `<h1>` , довольно просто.
## намек
Просто создайте `<h1>` и `this.state.name` между тегом.
## Решение
```react.js
class MyComponent extends React.Component {
constructor(props) {
super(props);
this.state = {
name: 'freeCodeCamp'
}
}
render() {
return (
<div>
{ /* change code below this line */ }
<h1>{this.state.name}</h1>
{ /* change code above this line */ }
</div>
);
}
};
```