为什么我的React Router无法正常工作?

时间:2016-04-16 20:00:33

标签: javascript reactjs react-router react-jsx react-routing

我正在研究一个例子并制作反应路由器.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

0 个答案:

没有答案