setState回调(第二个参数)现在在componentDidMount / componentDidUpdate之后立即触发,而不是在所有组件呈现之后触发。当下面的代码在react的两个版本中执行时,会有什么不同,即< 16和16。import logo from '.constructor(props) {
const [state, setState] = useState(0);
const testFunc = () => {}yield should wait till state is updated, only then it can be executed }
但是我不知道如何跟踪这个状态,因为setState钩子没有回调选项。