parse-community / ParseReact

Seamlessly bring Parse data into your React applications.
https://parseplatform.org
Other
1.3k stars 209 forks source link

Using Parse react query goes to local storage instead of Parse.com #133

Closed quantuminformation closed 8 years ago

quantuminformation commented 8 years ago

I have an observe function in a react native app that is needed by the Parse react mixin:

var PollingPage = React.createClass({
  mixins: [ParseReact.Mixin],
  observe: function (props, state) {
    var inOutQuery = (new Parse.Query('IsOut'));
    return state.isLoading ? {inOuts: inOutQuery} : null;
  }, 
//etc

however when this is run it goes off to look in local storage:

  getItem: function getItem(path) {
    return localStorage.getItem(path);
  },

I also created a SO tag for this repo and asked there:

http://stackoverflow.com/questions/33189079/using-parse-react-query-goes-to-local-storage-instead-of-parse-com

quantuminformation commented 8 years ago

The answer on github indicates the issue:

because window.localStorage not exist in JavaScriptCore. localStorage is a part of Web APIs, but JavaScriptCore is just an javascript engine, not "web browser". You should use AsyncStorage instead of localStorage.

Is there a way to correct this so we can use this library in react native?