Get ionic search text


I searching how to get the IonSearchbar input text when enter is pressed:

class Busqueda extends Component{

Buscar = () =>{

  return(<IonSearchbar onIonInput={this.Buscar}></IonSearchbar>);

What can I implement? thanks in advance.


Buscar = console.log

And see whats happening

Probably u need to add argument to Buscar

So: Buscar= (event)=> { etc}

Grab the event argument that is passed and use

<IonInput type="text" value={username} onIonInput={(e: any) => setUsername(} />