如何解决路由器导航中的反应?

时间:2019-05-01 03:17:58

标签: reactjs

local:localhost:3000 / product(正在运行) 服务器:“ https://www.example.com/product”(不起作用)

const routes = () => (
<Routesr >
<Switch>
<Route exact path={ "/" } component={ HomeScreen } />
<Route exact path={ "/login" } component={ LoginScreen } />
<Route path={ "/dashboard" } component={ AdminDashboardScreen } />
<Route exact path={ "/product" } component={ ProductScreen } />
<Route component={ Error } render={ () => <h1>404 Error</h1> } />
</Switch>
</Routesr>
);

and index.js

ReactDOM.render( <Router />, document.getElementById( "root" ) );

0 个答案:

没有答案