简体   繁体   English

使用Flow-Router时的React.createelement警告

[英]React.createelement warning when using flow-router

When I add this code to my Meteor app: 当我将此代码添加到Meteor应用程序中时:

Home =  FlowRouter.route("/", {
  name: "App",
  action(params) {
    ReactLayout.render(App);
  }
});

It shows this error in chrome console: 它在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).

What am I doing wrong? 我究竟做错了什么?

Okay, I managed to bypass this error by replacing action(params) with action function () , so my now my code looks like this: 好的,我设法通过用action(params) action function ()替换action(params)来绕过此错误,所以现在我的代码如下所示:

Home =  FlowRouter.route("/", {
  name: "App",
  action function() {
    ReactLayout.render(App);
  }
});

I don't know if it's the right solution, or what's causing this problem, it just seems to work for me, so maybe it'll work for someone having the same problem. 我不知道这是正确的解决方案,还是导致此问题的原因,它似乎对我有用,所以也许对有相同问题的人有用。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM