I’ve read this article at “Discovermeteor” , but the whole year had passed, since it was written.
In official tutorial and in LevelUp tutorial (which is rather new): createContainer from react-meteor-data is used.
So which techniques to load data in React are considered preferable today?
We use createContainer
in Galaxy, and it works great there. So unless you have some reason to prefer an alternative I’d go with that.
@sashko CreateContainer
now throws this error with React 15.5.3
:
Warning: MeteorDataContainer: React.createClass is deprecated and will be removed in version 16. Use plain JavaScript classes instead. If you're not yet ready to migrate, create-react-class is available on npm as a drop-in replacement.
Is there a plan to update this package to not use createClass
?
Since the package relies (AFAIK) on mixins and mixins are not available in Javascript classes, this will be … difficult.
The package only relies on mixins as an implementation detail. We’ll remove them ASAP so people don’t have to get the warning.
I’d also happily accept a PR converting the logic in the mixin to an HoC.
I use createContainer bound to a higher order component that receives the subscription, then disseminates it accordingly to child components.