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.