I heavily use collection helpers on that Portfolio object. However I am finding that the updates are not reactive. I think I can hack up a solution where I simply include an element in that component which is being updated by some other reactive data, and that would mean the collection helper would fire again… but maybe there is a better way?
I would get off of collection helpers, make an importable module that does all of the collection helper stuff, and then implement it inside the container, feeding it to the component you want to use it in as a property.
I have a huge amount of collection helpers. I use the collection helpers to interpret the data structures stored within that collection. I’ve built the whole app using collection helpers everywhere, its not really feasible to change. There are only a few components where this is an issue.
What you’re saying does make sense though, I could just have my own library which I import and feed the collection into.
I think the issue with my reactivity is that a certain few collection helpers load data from other collections. The component doesn’t know when that other collection has been updated… so its not updating my component.
Hi there. I also had the problem with collection helper + React. When switching routes to a new page, then back, the helper would return empty array. Did move Subscriber from Container Comp. to the root App Container Comp. and it worked, but after adding the query join condition, did fail again, so after more reading, found an answer.
React might display UI DOM before Meteor would load all data from Server Database. + React does re-render a component on props or state change. => That’s why it is important to have a “loading” property in Container Component for Child Component, which is going to change value from – loading – true (data did not load), to – false (data did load). On value change the Child Component will re-render, so when the data will be loaded, the component will re-render.