React.createelement 使用 flow-router 时的警告

React.createelement warning when using flow-router

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

我做错了什么?

好的,我通过将 action(params) 替换为 action function () 设法绕过了这个错误,所以我现在的代码如下所示:

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

我不知道它是否是正确的解决方案,或者是什么导致了这个问题,它似乎对我有用,所以也许它对遇到同样问题的人也有用。