JSX not being recognized by Meteor

- 1 answer

Ad

I am getting started with meteor and react. This is what I have done:

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

In routes.jsx, I have added the home page route:

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

In home.jsx, I have created a simple Home component.

In the browser console, I am getting an error: Unable to find "/".

If I convert the routes.jsx to route.js, then the routes work. But, I am getting the error: Not able to find the Home component in the browser log.

For some reason, the JSX is not being recognized by Meteor and not getting compiled to JS.

I have all the required packages - ecmascript, jsx, react, react-runtime.

Ad

Answer

Ad

Though I added kadira:react-layout, I had to explictly add react to the packages list. Adding react to the packages list fixed it.

Ad
source: stackoverflow.com
Ad