onSelectedShowdateChangeHandler() {
this.setState(
{ selectedShowdate: event.target.value },
this.getShowtimeList
);
}
Hi guys, I'm having a "event" is deprecated error here, not so sure what I should replace it with. Thank you so much
Event handler callbacks will be given an event object as an argument when invoked. Just add that argument to your function:
onSelectedShowdateChangeHandler(event) {
// Function body
}
It's up to you, but some prefer to just name it e or similar to avoid clashing with the "global" event object.
Something like this should work:
onSelectedShowdateChangeHandler(myEvent) {
this.setState(
{ selectedShowdate: myEvent.target.value },
this.getShowtimeList
);
}
I'm surprised you're still using it, unless you're using legacy code. event was deprecated years ago.