I\'m having an issue with posting data to an express REST API I have using fetch in my react-native app. Here\'s my code:
/**
* Sample React Na
You should bind in your constructor not in the render function. In your constructor, just add:
this.addData = this.addDate.bind(this);
You can also use ES6 as another alternative:
addData = () => { ... }
That will work to as documented here: https://babeljs.io/blog/2015/06/07/react-on-es6-plus under the arrow function section.