The react setState after action doesn't work.
handleChange = () => {
this.setState({foo: 'bar'}); < - it working
console.log('hellow') < - does not working, console is clean
}
As far i checked my state, I did everything right about the state values.
I don't know what is the problem
---- update----
The project that created a new create-react-app operates very normally.
I don't know why the above issue occurred, and it doesn't make sense in common sense, but it seems that it's because the project is so messed up.
Thank you for answering such limited situations.
Your code is correct but you need to call handleChange() method Ex :-
componentDidMount() {
this.handleChange();
}
handleChange = () => {
this.setState({ foo: "bar" });
console.log("Hello");
};