Parse-sdk-js: React implementation?

Created on 16 Sep 2016  路  6Comments  路  Source: parse-community/Parse-SDK-JS

Hey!
I am fairly new to Parse and try to find documentation/snippets/getting_started around Parse together with React (not Native).
Some may point me to "parse+react" package but it says it has been broken by new 1.8* version with Live Queries... I am not sure if it means Parse-SDK-JS now integrates gracefully with React without 3rd-party packages, or if they just stopped supporting it.
Anyways, I think I may just be confused on how to make a simple CRUD on Parse Parse using React (actually I managed to make my React code create an object on my Parse Server, however I did not find how to query nor live query). I guess the inventor of React AND Parse should have managed to make that run out-of-the-box (didn't they??).
If by any chance someone has a very little snippet to share on how I can just live query Parse using react... :heart:

Thank you guys!!

Most helpful comment

I'm actually working on a new library that is designed to work extremely well with React and Redux, including Live Queries functionality. It's currently out to some beta testers, but should be available more widely later on. Stay posted for updates.

All 6 comments

Hi,
This is what I do.
I use Redux and fetch my data in the action creation functions, using redux-thunk.
The problem is that I store Parse Objects, which are mutable, in the Redux store, which is supposed to store only immutable objects. So, the trick is to keep a version number next to the Parse Object and to increment it every time it is modified, so that the "connect" function triggers a component update.
Everything works fine this way.

Olivier Allouch
www.illicotravel.com

Hi,
I am not using Parse with live query with React but I convert the Parse object into normal JS object (it could also be immutable objects) before storing in the redux store. If I were to call use live query with it, I would just update the redux store with the new object in the live query event handler and the rest should work because the redux store would be updated and the connected components would see the change update themselves. Is there a problem in this approach?

Mmm... I am not at the level of using Redux so far. I just need a simple starting CODE to make both wonderful worlds to work together.
I found this repo and made a pull request to make it work, for those who are interested:
parse-react-sample

I close the issue but may reopen it separately to get solutions for live queries + react specifically.

Thanks anyways for your time @varungupta85 and @oallouch !!

I'm actually working on a new library that is designed to work extremely well with React and Redux, including Live Queries functionality. It's currently out to some beta testers, but should be available more widely later on. Stay posted for updates.

Sounds great, @andrewimm. Any updates on when this will be available?

If you need more beta testers, sign me up :)

EDIT: I think I found it ;-)

Any progress on this issue?

Was this page helpful?
0 / 5 - 0 ratings