setState是异步还是同步?
笔记:改setState为同步的三种方法
import React, { Component } from 'react'
export default class App extends Component {
constructor(props) {
super(props);
this.state = {
age: 18,
};
}
// 1.async await方法
update = (asy
原创
2020-11-16 09:24:13 ·
1160 阅读 ·
1 评论