开发者

React-router-dom not rendering component and Getting error GET http://localhost:8080/editor 404 (Not Found)

enter image description here

<Fragment>
       <Routes>
         <Route exact path="/" element={<Home />}></Route>
         <Route exact path="/editor" element={<EditorPad />} />
          <Route path="*" element={<Navigate to="/" />} />
        &开发者_JS百科lt;/Routes>
      </Fragment> 

I tried to use this as well

const root = ReactDOM.createRoot(document.getElementById("root"));
root.render(
  <Router>
    <App />
  </Router>
);

But it's not working. I am using react 18

"react": "^18.2.0",
"react-router": "^6.4.4",
"react-router-dom": "^6.4.4",

Please help me out Thanks

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜