const el = document.body
ReactDOM.render(<Hello name='John' />, el)
import React, {Component} from 'react'
import ReactDOM from 'react-dom'
class Hello extends Component {
...
}
constructor(props) {
super(props)
this.state = { username: undefined }
}
render () {
this.state.username
const { username } = this.state
···
}
this.forceUpdate()