I have trouble with arrow functions in react native. When I write an arrow function, I get an error saying
this.setstate is not a function
but when I write a regular function , I do not get any errors. Can someone tell me where is the problem. My code is below
var Register = React.createClass({
getInitialState : function(){
return {
ad:'',
soyad:'',
mail: '',
gcm_id:'',
},
componentWillMount: function() {
this.get_db();
},
get_db: async ()=> {
this.setState({ mail: 'adadsasd' });
},
})