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

199
Visualizações
How to create a button that leads to another site in a reactjs application?

After creating my app top navbar, I tried adding a button to it that will link to a website I created and display it in my app body. The website I'm looking to index is actually a search engine built in Python that allows the user to enter keywords into the search bar and get results. Here's what I'm trying to get picture

the arrow shows where the site should appear without making the navigation bar disappear. I then inserted the following code into my top navigation bar code file:

<Button
        component={NavLink}
        activeClassName={classes.activeBtn}
        to="https://gkwhelps.herokuapp.com"
        className={classes.buttonItemMiddle}
      >
        {location.pathname == 'https://gkwhelps.herokuapp.com' ? (
          <Home fontSize="large" style={{ color: 'rgb(0,133,243)' }} />
        ) : (
          <HomeOutlined fontSize="large" />
        )}
      </Button> 

and this in my App.js file :

<ProtectedRoute
                            exact
                            path="https://gkwhelps.herokuapp.com"
                           
                          />

My app runs fine on my browser, but when I click the button indexing the other site, my app body shows a blank page (but my navbar remains visible) and I'm taken to next http://localhost:3000/https://gkwhelps.herokuapp.com by my application. I don't get any command line errors. So I took inspiration from the following askcodez question and modified my code for the button this way:

<Link to='https://gkwhelps.herokuapp.com'>
      <button type="button" className="btn btn-info">Button</button>
      </Link>

but I get exactly the same errors as before.

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