please help me in the code. i have a problem with getInitialState(), the code isn't work: enter image description here
the mistake is on the picture, but i can't see this.
please help me in the code. i have a problem with getInitialState(), the code isn't work: enter image description here
the mistake is on the picture, but i can't see this.
You're using ES6 classes, which means you need to use a constructor to initialize the state:
class App extends Component {
constructor(props) {
super(props);
this.state = {
show: true
};
}
// ..
}
Reference: What is the difference between using constructor vs getInitialState in React / React Native?