如何将道具从FlowRouter 传递给我的反应组件。那可能吗?文档很棒。
我在做这样的事情:
FlowRouter.route('/dashboard', {
name: 'dashboard',
action(){
var x = Projects.find().fetch(); // this not working
console.log(x); // x is []. Why?
ReactLayout.render(App, {
nav: <Nav />,
content: <Profile data={x}/>
});
}
});
在我的应用程序中,我想说this.props.data
但数组是空的。我必须将逻辑放入反应组件中。这是正确的方法吗?我希望不是。