Skip to content

Commit 2c2127a

Browse files
Update column2.md
fix: update createRoot and make SII more generic
1 parent e2c5b75 commit 2c2127a

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/react/first-side/column2.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,9 @@ class HelloMessage extends React.Component {
1313
}
1414
}
1515

16-
ReactDOM.render(<HelloMessage msg={'SII CANADA'}/>, document.getElementById('root'))
16+
const root = ReactDOM.createRoot(document.getElementById('root'));
17+
root.render(<HelloMessage msg={'SII'}/>);
18+
1719
```
1820

1921
```js
@@ -41,4 +43,4 @@ this.setState({firstName: 'Johnny'})
4143
If you have to use precedent state, you should give to setState a function.
4244
```js
4345
this.setState((state) => ({ age: state.age + 1 })
44-
```
46+
```

0 commit comments

Comments
 (0)