-
Notifications
You must be signed in to change notification settings - Fork 53
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
share-js with React #63
Comments
If you look at the code, it does make use of the Blaze APIs, so I don't think you can just drop it in React like that. |
Here a copy and paste from my AceEditor React component.
And you can use it like this:
|
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I'm trying to use this template with ReactJS, by wrapping it in the blazetoreact package and rendering it that way.
I've got a documents collection, and am passing the mongo ID to docid.
Here's the component I'm using shareJS in:
The result is that once I click a button (other component) to insert a new document, I'm seeing a textarea rendered, with '....loading' in it. And that's it. No functionality.
Troubleshooting: I can see the ops collection being created in my mongo, but there's no sign of the docs collection.
I've been able to setup shareJS with blaze just fine, no issues there: a click on a button creates a new Document, set the id to docid on a Session variable & presto, I can see the docs collection getting created in mongo & I'm good to go.
So far, that seems to be the one thing that's different: I'm not using Session in React.
So I'm wondering: does this package depend on usage of Session? Or is there another way to trigger the creation of the shareJS docs collection?
If there's no way to use this in Meteor + React, I'll use the plugin as is in a Blaze template, but I'd rather stick to a uniform codebase, if I can.
update: I've tried setting the document on a session variables and passing that through the docid prop, but no luck so far. This is most likely something to do with data-context not begin set correctly, I guess?
The text was updated successfully, but these errors were encountered: