after using browserHistory, the dva can jump to the second-level route normally after configuring the second-level route, but it cannot be refreshed. Refreshing will cause the page to become blank. I have found a solution on the Internet, which is mainly based on the server configuration. I want to be able to refresh the blank during development. I do not know how to configure
index.js to use
import createHistory from "history/createBrowserHistory";
const app = dva ({history: createHistory ()}).
Main.js
class Main extends React.Component {
render() {
return (
<div>
<div>
<Link to="/first" >1</Link><Link to="/second" >2</Link>
</div>
<div>
<Route path="/" render={() => (
<div>
<Switch>
<Route path="/first" exact component={First} />
<Route path="/second" component={Second} />
<Route path="/first/three" component={Three} />
</Switch>
</div>
)} />
</div>
</div>
);
}
}
First.js
class First extends React.Component {
render() {
return (
<div>
<Link to="/first/three"></Link>
</div>
);
}
}
Second.js and Three.js
class Second extends React.Component {
render() {
return(
<div></div>
);
}
}
/first/three
The
page will disappear, ask for guidance