I have already checked the setState() and React.Component class source code of the React official document. Nevertheless, the question about the prevState passed to the parameter of the setState() function has not been resolved. Developers know that when you declare a class-type component and inherit React.Component, you can change the state through setState internally and use prevState without this.state or declarer.
What I am curious about is, whether it is possible to bring the first parameter inside the state of the code below to a precarious state?
class App extends React.Component {
state = {
count: 0,
}
setState((prevState) => ({...prevState, count: prevState.count + 1}));
render() {
return <div>{this.state.count}</div>
}
}