kadirahq / mantra

Mantra - An Application Architecture for Meteor
https://kadirahq.github.io/mantra/
978 stars 52 forks source link

Problems with @storybook/mantra-core and react-komposer@2 #205

Open fortuneNyl opened 6 years ago

fortuneNyl commented 6 years ago

have a meteor v1.6.1 app, with react@16.2.0. But I have a problem with the composeWithTracker function. This function have been taken off react-komposer@2, used by storybook, but is still declared in /dist/index. So, I have a question. How could I send data from my containers to my components? Need help please. When I do this in my container with : import {useDeps, composeWithTracker, composeAll} from ''; export const classeComposer = ({context}, onData) =>{ const {Meteor, FlowRouter, Collections,} = context(); if (Meteor.subscribe('classes.list').ready()){ const lesClasses = Collections.Classes.find({}, {fields: {_id:1, code:1, nbrePlaces:1}, sort: {code:1, nbrePlaces:1}}).fetch(); const nbreClasses = Collections.Classes.find({}).count(); onData(null, { lesClasses, nbreClasses}); }else{ onData(); } }; export const classeMapper = (context, actions) => ({ addclasse: actions.classes.addclasse, updateclasse: actions.classes.updateclasse, deleteclasse: actions.classes.deleteclasse, context: () => context });

export default (component) => composeAll( composeWithTracker(classeComposer), useDeps(classeMapper) )(component); I have this error in my consol: Uncaught (in promise) TypeError: composeWithTracker is not a function at eval (/imports/modules/core/containers/Classes.js:88:21) at Route._callee$ (http://localhost:4000/app/app.js?hash=9e577aa13e8896245acee791ed37df88948a09c2:381:32) at tryCatch (http://localhost:4000/packages/modules.js?hash=5763c96b3eee7f2b55565963c705a396d19a512b:34210:40) at Generator.invoke [as _invoke] (http://localhost:4000/packages/modules.js?hash=5763c96b3eee7f2b55565963c705a396d19a512b:34444:22) at Generator.prototype.(anonymous function) [as next] (http://localhost:4000/packages/modules.js?hash=5763c96b3eee7f2b55565963c705a396d19a512b:34262:21) at tryCatch (http://localhost:4000/packages/modules.js?hash=5763c96b3eee7f2b55565963c705a396d19a512b:34210:40) at invoke (http://localhost:4000/packages/modules.js?hash=5763c96b3eee7f2b55565963c705a396d19a512b:34300:20) at http://localhost:4000/packages/modules.js?hash=5763c96b3eee7f2b55565963c705a396d19a512b:34310:13 at http://localhost:4000/packages/meteor.js?hash=b0f12795c8cc1423b5850502871996903f947ed5:1167:22 at

Need help please.

paranoico commented 4 years ago

Hey, long time since you posted but hoping to share future clarity: Mantra works only with Meteor 1.5 and uses React 15.

We had 3 apps made with Mantra and Meteor 1.5, but from a year ago we are porting all of them to use react-meteor-data component following the standard Meteor 1.9, React 16 tutorial.

Regards.