JSX not being recognized by Meteor
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
Related Questions
Ad
- → Material-ui LeftNav with Toolbar not working
- → How to control meteor data stream with react?
- → Render array of inputs in react
- → Setting Page Title with useraccounts:flow-router
- → Convert a collectionFS file from filesystem to gridFS on serverside
- → Meteor Accounts add extra fields
- → React + Parse or React + Meteor?
- → Meteor: ReactMeteorData with Ecmascript6
- → Implement SEO to Meteor app the right way
- → Meteor: file upload error
- → Meteor: Iterating over an Object inside of a Collection
- → Node JS project where client side javascript variables persist?
- → Meteor + React how to set the value of a lot of input elements and modify them after
Ad