为什么BootStrap效果显示不出来
因为版本不对的原因,React-BootStrap与BootStrap版本要相配。
本人取了如下的匹配
“bootstrap”: “^4.6.0”,
“react-bootstrap”: “^1.5.2”,
这个问题困扰了好长时间,网上没有现成的解答,后来看了它提供的示例,才明白。
示例在如下链接里
https://github.com/react-bootstrap/code-sandbox-examples/blob/master/README.md
路由器的控制
1、用MemoryRouter包起来
所有的跟路由作用相关的代码,用MemoryRouter包裹起来。
2、定义Router内部的内容
const Home = () => <span>Home</span>;
const About = () => <span>About</span>;
const Users = () => <span>Users</span>;
3、路由切换Switch
<h2>
Current Page is{
' '}
<Switch>
<Route path="/about">
<About />
</Route>
<Route path="/users">
<