Hello all. Been building my first Meteor app for a few months now using MaterialUI and ReactJS. It’s coming along well!
Up until now I’ve just been using useTracker with the normal Collection.find().fetch() from the documentation. Everything is working fine.
Today I decided to try the “useFind” capability from react-data-hooks so I could get some of that fine-grained updating goodness. However, useFind seems to not update the query when I change the value of the arguments. It will only update it if I change the names of the arguments.
Example:
useFind(() => MyCollection.find({stuff: 4})) // Works perfectly
// Sometime later after the query needs to change
useFind(() => MyCollection.find({stuff: 7})) // Does NOT change the query results!
// Sometime later after the query needs to change again
useFind(() => MyCollection.find({other_stuff: 12})) // Will then work perfectly again!
So: what I’m seeing is that calling useFind is not updating the query results unless the name of the query results changes.
Any idea what’s going on here?
One more piece of info: the actual query JSON is built before calling useFind (just above it)… could that have anything to do with it?