答案 0 :(得分:1)
答案 1 :(得分:-1)
这就是React Router的用途。
<强> Schema::create('throttle', function(Blueprint $table)
{
$table->increments('id');
$table->integer('post_id')->unsigned(); // this needs to also be nullable, how should the next migration be?
}
强>
Routes.js
<强> import React from 'react';
import {BrowserRouter,Switch,Route, withRouter} from 'react-router-dom';
import FirstPage from './pages/FirstPage';
import SecondPage from './pages/SecondPage';
class Routes extends React.Component {
render() {
return(
<Switch>
<Route exact path="/page-1" component={FirstPage} />
<Route exact path="/page-2" component={SecondPage} />
</Switch>
)
}
}
强>
App.js