Quantcast
Channel: Ionic Framework - Ionic Forum
Viewing all articles
Browse latest Browse all 49183

IonIcon go back click event

$
0
0

Hello everyone.

It has an IonIcon with an arrow and I need to press it to return to the previous page. How is it possible to implement that?

What I get is:

Object is possibly ‘undefined’.ts(2532)

in this.props.history.push(’/’) sentences

const Ingresar: React.FC = () => {

    const goBack = () => {
        this.props.history.push('/')
        };

  return (
    <IonPage>
      <IonHeader>
      <IonToolbar>
        <IonGrid>
          <IonRow>
          <IonCol><IonIcon icon={arrowBack} onClick={goBack} slot="start" id="flecha-volver">  </IonIcon></IonCol>
          <IonCol id="columna2" ><strong id="texto-pagina">Registro de usuario</strong></IonCol>
          </IonRow>
        </IonGrid>
      </IonToolbar>
      </IonHeader>
      <IonContent fullscreen>
        <IngresarDatos></IngresarDatos>
      </IonContent>
    </IonPage>
  );
};

Thanks in advance.

1 post - 1 participant

Read full topic


Viewing all articles
Browse latest Browse all 49183

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>