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

343
Vistas
Ionic Button click navigate to another page

Hi I have a little problem using the ionic framework on react, what i want is when i click the login button it will navigate to homepage, the current behavior in my code is when typing in the browser url /homepage it works well but when clicking the button login it didnt navigate to homepage, I dont know why

Login.tsx

const Login: React.FC = () => {
    const history = useHistory();
    const homepage = () =>{
        console.log("ss")
        history.push("/homepage");
    }
    return (
           .....
           <IonButton   onClick={homepage}  color="success" shape="round" size='default' className='submitButton'>
           <span className='login-button'>Login</span>
           </IonButton>
    )
}

App.tsx

const App: React.FC = () => (
  <IonApp>
    <IonReactRouter>
      <IonRouterOutlet>
        <Route exact path="/login">
          <Login/>
        </Route>
        <Route exact path="/homepage" component={Homepage}></Route>
        <Route exact path="/">
          <Redirect to="/login" />
        </Route>
      </IonRouterOutlet>
    </IonReactRouter>
  </IonApp>
);
about 4 years ago · Juan Pablo Isaza
1 Respuestas
Responde la pregunta

0

for navigate between Routes try useNavigate Hooks

about 4 years ago · Juan Pablo Isaza Denunciar
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