-
Notifications
You must be signed in to change notification settings - Fork 113
Components not updating reactively when Collection is udpated #64
Comments
I was able to get this to work by wrapping the React.render() in a Tracker.autorun() call. Now when the collection set in the state is updated, the component is rendered automatically as well.
Should this be added to the documentation? |
I'm having this issue as well. It seems to have happened after one of the most recent updates either to Meteor or this package (or dependencies). I tried the Tracker.autorun fix mentioned above, but it did not work for me. I am using FlowRouter https://github.com/meteorhacks/flow-router/ not sure if that has anything to do with it. It worked perfectly previous to one of the last updates.
calling code:
I have tried this code with and without For what it's worth, I can see the Is it possible it's being cached and not being updated? |
+1 |
Ok, worked for me with fetch() |
Same here, had to change from this:
to this:
|
+1 Expected: reactive with |
A few things make react non-reactive:
|
From the https://github.com/ultimatejs/tracker-react readme: |
Currently, it seems like a setState must be called in order to trigger a re-render. This may be by design for this package. However, given some of the content in the Meteor tutorials, it seems like the ideal functionality would be for a react component to be re-rendered if a Collection is updated, when its state depends on that Collection.
Even updates to Mongo via the command line should trigger a re-render, as it currently does with Blaze. Maybe another key could be added to the mixin?
The text was updated successfully, but these errors were encountered: