Reputation: 77
I am new to react native and I am using ES5 standard and I don't know how to use props in ES5.Please help me and please do share snippet....
const SharePhotoPage= React.createClass({
render() {
return (
<View >
</View>
);
},
});
Upvotes: 2
Views: 176
Reputation: 2478
Because you use React.createClass instead of ES6 class, you should call getInitialState() to init state and pass props to it. For example:
var Header = React.createClass({
getInitialState: function() {
return {
title: this.props.title
};
},
});
Cheer!
Upvotes: 1