最佳答案
Out of curiosity, I just wanna know what will happen if I use setState()
function in constructor of a Class in React Native or ReactJS?
Such as:
constructor(props) {
super(props);
this.setState({title: 'new title'});
}
what's the lifecycle of React gonna happen?
I haven't read the code inside React. I am afraid it will some any damage when I write it that way.