score:0

Accepted answer

handlechange should be:

handlechange(selectedoption) {
  this.setstate({criteria: selectedoption});
}

selectedoption type is:

{
 value: string,
 label: string
}

score:0

figured it out, thanks to armin yahya for pointing me towards the right direction, as i was not aware of the selectedoption type. here's what i ended up writing that has my handlechange function working properly and updating the url for the api call:

handlechange(selectedoption) {
  if(selectedoption.value == 'name') {
      this.setstate({criteria: 'patient?name='});
    
  }
  if(selectedoption.value == 'bday') {
    this.setstate({criteria: 'patient?birthdate=eq'});
    
    
  }

Related Query

More Query from same tag