Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

353
Visualizações
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 à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda