1

as I understand, after building the project, the bundle does not load, or I write something wrong in the router-dom, or I need to add something to json.. an empty screen..

import React from "react"; import { Routes, Route } from "react-router-dom"; import Home from './app/home/Home'; import AboutTheProject from './app/home/pages/page_1/AboutTheProject'; import HowItWorks from './app/home/pages/page_3/HowItWorks'; import Detailed from './app/home/pages/page_3/moreDetailed/Detailed'; import RedactorMenu from './app/workspace/RedactorMenu'; import Title from './app/workspace/Title'; function App() { return ( <div className="app"> <Routes> <Route path="/" element={<Home />} /> <Route path="/about" element={<AboutTheProject />} /> <Route path="/works" element={<HowItWorks />} /> <Route path="/works/detailed" element={<Detailed />} /> <Route path="/workspace" element={<RedactorMenu />} /> <Route path="/workspace/prototype" element={<Title />} /> </Routes> </div> ); } export default App; 

.....

import * as ReactDOMClient from 'react-dom/client'; import { BrowserRouter } from 'react-router-dom'; import App from "./App"; const root = ReactDOMClient.createRoot(document.getElementById('root')); root.render( <BrowserRouter> <App /> </BrowserRouter> ); 

enter image description here enter image description here enter image description here

I tried to change the router but it doesn't help. blank screen

11
  • How do you serve the files? Commented Dec 4, 2022 at 16:35
  • @gorden Please don't use images where is no need. Write code instead of images. Commented Dec 4, 2022 at 16:37
  • in what sense do I serve files? Commented Dec 4, 2022 at 16:41
  • @gorden, as I'm seeing, look fine in my side. In any case, check your HTML file and div which have ID. maybe it's cause that problem. Commented Dec 4, 2022 at 16:50
  • 1
    Why do you have "/build" in your URL? "/build" is not registered as a Route and you dont have a fallback routes (404 one). Commented Dec 4, 2022 at 16:56

0

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.