0
反応し、ルータを使用して、コンテナ内のクエリパラメータをアクセスもして反応-komposeする方法:流星、リアクト・ルーター、-komposer反応する - 渡すパラメータ
私はこのような抱き合わせていますが、それは動作していない:
routes.js
...
Meteor.startup(() => {
render(
<Router history={ browserHistory }>
<Route path="/" component={ App }>
<IndexRoute name="index" component={ Index } onEnter={ requireAuth } />
<Route name="documents" path="/documents" component={ Documents } onEnter={ requireAuth } />
<Route name="list-projects" path="/list-projects" component={ Projects } onEnter={ requireAuth } />
<Route name="add-project" path="/add-project" component={ AddProjectPage } onEnter={ requireAuth } />
<Route name="project-detail" path="/project/:projectId" component={ProjectDetailPage} onEnter={ requireAuth } />
<Route name="login" path="/login" component={ Login } />
<Route name="recover-password" path="/recover-password" component={ RecoverPassword } />
<Route name="reset-password" path="/reset-password/:token" component={ ResetPassword } />
<Route name="signup" path="/signup" component={ Signup } />
<Route path="*" component={ NotFound } />
</Route>
</Router>,
document.getElementById('react-root')
);
});
container1.js
import { composeWithTracker } from 'react-komposer';
import { Projects } from '../../api/projects/projects.js';
import { ProjectDetail } from '../components/project-detail.js';
import { Loading } from '../components/loading.js';
import { Meteor } from 'meteor/meteor';
const composer = (params, onData) => {
const subscription = Meteor.subscribe('projects');
if (subscription.ready()) {
const project = Projects.find({_id:params._id}).fetch();
onData(null, { project});
}
};
export default composeWithTracker(composer, Loading)(ProjectDetail);