回答編集履歴
1
Typo
test
CHANGED
@@ -10,17 +10,17 @@
|
|
10
10
|
|
11
11
|
|
12
12
|
|
13
|
-
co
|
13
|
+
componentで何らかの外部のイベントをリッスンしたいときは、ライフサイクルメソッドの[componentDidMount](https://reactjs.org/docs/react-component.html#componentdidmount)でリスナーを設定し、[componentWillUnmount](https://reactjs.org/docs/react-component.html#componentwillunmount)で解除するようにするのが普通です。
|
14
14
|
|
15
15
|
|
16
16
|
|
17
|
-
```js
|
17
|
+
```jsx
|
18
18
|
|
19
19
|
ReactDOM.render( < NewTab / > , document.getElementById('root'));
|
20
20
|
|
21
21
|
|
22
22
|
|
23
|
-
class
|
23
|
+
class NewTab extends React.Component {
|
24
24
|
|
25
25
|
constructor(props) {
|
26
26
|
|