Почему setState выводит значение конечного состояния только в функциональном состоянии setState?

#reactjs Вопрос: import React from 'react'; class Add extends React.Component { constructor(props) { super(props); this.state = { count: 0 }; } componentDidMount() { console.log('componentDidMount called'); } componentDidUpdate(prevProps, prevState) { console.log('componentDidUpdate…

Продолжить чтениеПочему setState выводит значение конечного состояния только в функциональном состоянии setState?