I'm using the @ionic-react library and now I have to add a simple IonToggle true/false value but I'm stuck, I can't handle changes and the funny thing is if I print on screen the new value I see "on" every time. How can I handle events in @ionic-react Toggle?
Code:
import { IonToggle } from "@ionic/react";
/...
.../
<IonItem>
<IonLabel color="primary" position="stacked">
Enable Photo
</IonLabel>
<IonToggle datatype = "boolean" onChange={(e) => {console.log('test')}}/>
</IonItem>
I expect true/false value. Do you have any idea? :)