I have an app where I want to move the read, write operations to a utility file i.e. away from component. I am trying to do it this way.
component.js
imp
Need to bind this to setState.
this
setState
saveData(this.setState.bind(this), data);
Working codesandbox demo