账号密码登录
微信安全登录
微信扫描二维码登录

登录后绑定QQ、微信即可实现信息互通

手机验证码登录
找回密码返回
邮箱找回 手机找回
注册账号返回
其他登录方式
分享
  • 收藏
    X
    react-router-dom 引入 IndexRoute 报错 is not exported
    44
    0
    import { BrowserRouter as Router, Switch, Route, Link, IndexRoute } from "react-router-dom";import Container from "./views/container"import Login from "./views/login"import NotFund from "./views/404"import { Home, About } from "./views/export"export default function App() { return ( <main> <Router> <Switch> <Route path="/" component={Container}> <IndexRoute path="/Home" component={Home} /> <Route path="/About" component={About} /> </Route> <Route path="/login" component={Login} /> <Route component={NotFund} /> </Switch> </Router> </main> );编译报错:Attempted import error: 'IndexRoute' is not exported from 'react-router-dom'.这样写是有什么问题吗,为啥保持说IndexRoute不是从react-router-dom中导出的其他的都正常,就是没法使用IndexRoute,求大佬指点
    0
    打赏
    收藏
    点击回答
        全部回答
    • 0
    更多回答
    扫一扫访问手机版
    • 回到顶部
    • 回到顶部