Home > Software design >  IonNav is not working with react 18 or ionic 6
IonNav is not working with react 18 or ionic 6

Time:10-17

here im using IonNav. import { IonNav } from "@ionic/react"; im getting blank screen with IonNav

return(
       <IonPage>
        <IonNav className="nav">
          <div>
            <h1>Please help</h1>
          </div>
        </IonNav>
      </IonPage>
     )

CodePudding user response:

Move it to the root callback

 return (
    <IonNav
      root={() => (
        <div>
          <h1>Please asd</h1>
        </div>
      )}
    ></IonNav>
  );

https://stackblitz.com/edit/angular-vytfp1-5pkrwm?file=src/main.tsx,src/index.tsx

  • Related