0
如何將道具從FlowRouter傳遞給我的反應組件。那可能嗎?文檔非常棒。將ReactJs道具分配給FlowRouter
Im做這樣的事情:
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
但數組是空的。我必須將邏輯放入反應組件。那是正確的方法嗎?我希望不是。
謝謝,但我得到'ReferenceError:myProjects未定義'指向'data = {myProjects}' – Sylar
是的。謝謝 – Sylar