Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/javascript/468.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Javascript 使用flow router时React.createelement警告_Javascript_Meteor_Reactjs_React Jsx - Fatal编程技术网

Javascript 使用flow router时React.createelement警告

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

当我将此代码添加到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 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