Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

341
Views
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 answers
Answer question

0

for navigate between Routes try useNavigate Hooks

about 4 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!