我的React版本是:16.13.1,而我的LookAtWorldX=(Camera.x)+(Vector.x*Depth);
版本是:5.1.2。
仅当我刷新页面时组件才会更新,只有链接会更改,但组件不会呈现。
React-router-dom
链接代码以更改路线:
import React from "react";
import { BrowserRouter as Router, Route, Switch } from "react-router-dom";
import Todo from "./components/Todo/Todo";
import About from "./components/About/About";
const Routes = () => (
<Router>
<Switch>
<Route exact path='/' component={Todo}/>
<Route path="/about" component={About}/>
</Switch>
</Router>
);
export default Routes;