parse-community / ParseReact

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

Normal example ParseReact and ES6 #176

Open arg2u opened 8 years ago

arg2u commented 8 years ago

Pls can u give us good example with observe() in es6 pls?

meilers commented 8 years ago

http://blog.beach.io/blog/the-future-of-web-apps-hammer-reactjs-parse-forge

arg2u commented 8 years ago

Yes, it good example with Es 2015, but in Es 6 using ParseReact.Component not work. And now I need ecmascript example with work code. I use webpack + react

marcusfelix commented 8 years ago
var Parse = require('parse').Parse;
var ParseReact = require('parse-react');
var React = require('react');
var ParseComponent = ParseReact.Component(React);

export default class TodoList extends ParseComponent {
  observe(props, state) {
    return {
      items: new Parse.Query('TodoItem').ascending('createdAt')
    };
  }
}

The ToDo app in demos folder is a good example of ParseReact + ES6 https://github.com/ParsePlatform/ParseReact/tree/master/demos/todo