Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/meteor/3.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
Meteor 流星没有认出JSX_Meteor_Reactjs - Fatal编程技术网

Meteor 流星没有认出JSX

Meteor 流星没有认出JSX,meteor,reactjs,Meteor,Reactjs,我正在开始与流星和反应。这就是我所做的: meteor create simple-react meteor add kadira:flow-router meteor add kadira:react-layout mkdir client server lib mkdir client/components touch client/head.html touch lib/routes.jsx 在routes.jsx中,我添加了主页路由: FlowRouter.route("/", {

我正在开始与流星和反应。这就是我所做的:

meteor create simple-react
meteor add kadira:flow-router
meteor add kadira:react-layout

mkdir client server lib
mkdir client/components
touch client/head.html
touch lib/routes.jsx
在routes.jsx中,我添加了主页路由:

FlowRouter.route("/", {
 name: "Home",
 action(params) {
   ReactLayout.render(Home);
 }
});
在home.jsx中,我创建了一个简单的home组件

在浏览器控制台中,我收到一个错误:找不到“/”

如果我将routes.jsx转换为route.js,那么这些路由就会工作。但是,我得到了一个错误:无法在浏览器日志中找到主组件

出于某种原因,Meteor无法识别JSX,也无法将其编译为JS


我有所有必需的包—ecmascript、jsx、react、react runtime。

虽然我添加了kadira:react布局,但我必须明确地将react添加到包列表中。将react添加到包列表修复了它。

您需要创建一个
Home
组件
Home=react.createClass({})
我已经有了一个Home组件。修正了错误。不知道为什么。我必须做一个“流星添加反应”明确。