Javascript 使用flow router时React.createelement警告
当我将此代码添加到Meteor应用程序时:Javascript 使用flow router时React.createelement警告,javascript,meteor,reactjs,react-jsx,Javascript,Meteor,Reactjs,React Jsx,当我将此代码添加到Meteor应用程序时: Home = FlowRouter.route("/", { name: "App", action(params) { ReactLayout.render(App); } }); 它在chrome控制台中显示此错误: Warning: React.createElement: type should not be null, undefined, boolean, or number. It should be a stri
Home = FlowRouter.route("/", {
name: "App",
action(params) {
ReactLayout.render(App);
}
});
它在chrome控制台中显示此错误:
Warning: React.createElement: type should not be null, undefined, boolean, or number. It should be a string (for DOM elements) or a ReactClass (for composite components).
我做错了什么?好的,我用
操作函数()
替换操作(参数)
成功绕过了这个错误,所以我现在的代码如下所示:
Home = FlowRouter.route("/", {
name: "App",
action function() {
ReactLayout.render(App);
}
});
我不知道它是否是正确的解决方案,或者是什么导致了这个问题,它似乎对我有效,所以可能对有同样问题的人也有效。是
ReactLayout
一个react组件吗?不,它假设App
是一个react组件,那么它可能没有被导入并正确传递到ReactLayout.render
。遵循堆栈跟踪,确保应用程序确实是一个ReactClass