我目前正在研究material-ui和React,但无法将此功能组件转换为标题的类组件。 https://codesandbox.io/s/3kwos
答案 0 :(得分:0)
希望这会有所帮助。
const [myState, setMyState] = useState('my value')
becomes
constructor(props) {
super(props)
this.state = {
myState: 'my value'
}
}
and you can just use
this.setState({ myState: 'my new value' })
to update the state's value
this.