Commit e9ba0ae9 by baiguangyao

修改 HashRouter as Route Warning的问题

parent aa92f3d6
import React from 'react'
import { Nav } from './common'
class menu extends React.Component {
render(match) {
return (
<div className='tabbar' style={{ position: "fixed", width: "100%", bottom: 0 }}>
<Nav />
</div>
)
}
}
export default menu;
import React from 'react';
import { Nav } from './common';
class menu extends React.Component {
render(match) {
return (
<div className='tabbar' style={{ position: "fixed", width: "100%", bottom: 0 }}>
<Nav />
</div>
)
}
}
export default menu;
import React from 'react'
import { HashRouter as Router, Switch, Route } from 'react-router-dom';
import Menu from './menu';
import Index from './components/Index';
import Classify from './components/classify';
import Study from './components/study';
import My from './components/my';
const router = () => (
<Router>
<Switch>
<Route exact path="/" component={Index}></Route>
<Route path="/index" component={Index}></Route>
<Route path='/classify' component={Classify}></Route>
<Route path='/study' component={Study}></Route>
<Route path='/my' component={My}></Route>
</Switch>
<Menu />
</Router>
)
export default router;
\ No newline at end of file
import React from 'react'
import { Router, Switch, Route } from 'react-router-dom';
import Menu from './menu';
import Index from './components/Index';
import Classify from './components/classify';
import Study from './components/study';
import My from './components/my';
const router = () => (
<Router>
<Switch>
<Route exact path="/" component={Index}></Route>
<Route path="/index" component={Index}></Route>
<Route path='/classify' component={Classify}></Route>
<Route path='/study' component={Study}></Route>
<Route path='/my' component={My}></Route>
</Switch>
<Menu />
</Router>
)
export default router;
\ No newline at end of file
import React from 'react'
import { BrowserRouter as Router, Switch, Route } from 'react-router-dom';
import Menu from './menu';
import Index from './components/Index';
import Classify from './components/classify';
import Study from './components/study';
import My from './components/my';
const router = () => (
<Router>
<Switch>
<Route exact path="/" component={Index}></Route>
<Route path="/index" component={Index}></Route>
<Route path='/classify' component={Classify}></Route>
<Route path='/study' component={Study}></Route>
<Route path='/my' component={My}></Route>
</Switch>
<Menu />
</Router>
)
export default router;
\ No newline at end of file
import React from 'react';
import { BrowserRouter as Router, Switch, Route } from 'react-router-dom';
import Menu from './menu';
import Index from './components/Index';
import Classify from './components/classify';
import Study from './components/study';
import My from './components/my';
const router = () => (
<Router>
<Switch>
<Route exact path="/" component={Index}></Route>
<Route path="/index" component={Index}></Route>
<Route path='/classify' component={Classify}></Route>
<Route path='/study' component={Study}></Route>
<Route path='/my' component={My}></Route>
</Switch>
<Menu />
</Router>
)
export default router;
\ No newline at end of file
import React from 'react'
import { Nav} from './common'
import React from 'react';
import { Nav } from './common';
class menu extends React.Component {
......
import React from 'react'
import { HashRouter as Router, Switch, Route } from 'react-router-dom';
import React from 'react';
import { BrowserRouter as Router, Switch, Route } from 'react-router-dom';
import Menu from './menu';
import Index from './components/Index';
......@@ -12,17 +12,14 @@ import My from './components/my';
const router = () => (
<Router>
{/* <div style={{ backgroundColor: 'rgb(245, 245, 249)', textAlign: 'center' }}> */}
<Switch>
<Route exact path="/" component={Index}></Route>
<Route path="/index" component={Index}></Route>
<Route path='/classify' component={Classify}></Route>
<Route path='/study' component={Study}></Route>
<Route path='/my' component={My}></Route>
</Switch>
<Menu />
{/* </div> */}
<Switch>
<Route exact path="/" component={Index}></Route>
<Route path="/index" component={Index}></Route>
<Route path='/classify' component={Classify}></Route>
<Route path='/study' component={Study}></Route>
<Route path='/my' component={My}></Route>
</Switch>
<Menu />
</Router>
)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment