-
Notifications
You must be signed in to change notification settings - Fork 25.1k
getInitialState not working in Movies Tutorial #5348
Copy link
Copy link
Closed
Labels
Resolution: LockedThis issue was locked by the bot.This issue was locked by the bot.
Description
Trying to follow the React Native tutorial with the Movies app.
Using iOS or Android everything goes fine until we try to introduce state into the component.
The tutorial does not use ES6 classes but the Hello World App does and this is where it gets confusing.
The tutorial says to add getIntialState which breaks I assume due to using ES6 classes, however using a constructor also does not seem to work so I wanted to know what is the correct way to proceed?
Tutorial
getInitialState: function() {
return {
movies: null,
};
},ES6 Equivalent?
constructor(props) {
super(props);
this.state = {
movies: null,
};
},Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
Resolution: LockedThis issue was locked by the bot.This issue was locked by the bot.