Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

352
Vistas
Pages not linking with HashRouter (react-router-dom) and electron-forge

I'm using electron-forge with react and I'm trying to set up routing using HashRouter in my app using react-router-dom. My app uses links in the sidebar to navigate through the various routes. I tried to set up a HashRouter in the app and no errors pop up when compiling, but nothing shows up when the code is running. All the pages that it links to are blank and the components aren't displayed.

I suspect this might be because electron-forge is hosting my app on localhost:3000/main_window instead of localhost:3000/ itself. Is there any way I can host the app on localhost:3000/ itself or is there an additional step in setting up HashRouters as compared to BrowserRouters in react-router-dom?

This is how the Routes were set up:

<HashRouter>
  <Routes>
    <Route path="/" exact component={Home} />
    <Route path="/classes/:classId" component={ViewClass} />
    <Route path="/addClass" component={AddClass} />
  </Routes>
</HashRouter>

This is the button with the link to the Home Route:

<button className="nav-icon">
  <FontAwesomeIcon icon={solid('home')} />
  <Link className="nav-icon-text" to="/">Home</Link>
</button>

When the app starts, it automatically hosts to localhost:3000/main_window and nothing is shown. When the sidebar button is pressed, it links to localhost:3000/main_window#/ which doesn't show anything either.

Does anyone know what the problem is here?

about 4 years ago · Juan Pablo Isaza
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda