我正在研究一个例子并制作反应路由器.Below是我的代码。但是当我运行我的代码时,它给了我错误"意外的语法"在<开头线上路由器> .Below是代码:
var React = require('react');
var ReactRouter = require('react-router');
var Router = ReactRouter.Router;
var Route = ReactRouter.Route;
var Base = require('./components/base.jsx');
var PageOne = require('./components/pageone.jsx');
var PageTwo = require('./components/pageTwo.jsx');
var Route = function(){
<Router>
<Route path="/PageOne" component= {PageOne}></Route>
<Route path="/pageTwo" component= {PageTwo}></Route>
</Router>
}
module.exports = Route;
有人可以检查并让我知道我在哪里做错了吗?
谢谢, NEHA