相关文章推荐
眉毛粗的油条  ·  jQuery键盘事件详解·  1 月前    · 
宽容的领带  ·  关于我们 | Super Micro ...·  1 月前    · 
考研的大脸猫  ·  Socket ...·  1 年前    · 
Collectives™ on Stack Overflow

Find centralized, trusted content and collaborate around the technologies you use most.

Learn more about Collectives

Teams

Q&A for work

Connect and share knowledge within a single location that is structured and easy to search.

Learn more about Teams
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.

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.

Ohh, what does "deprecated" mean tho? Sorry for the stupid questions I'm actually not very familiar with Javascript. But yeap, it is legacy codes from my company, written many many years ago. – Jerome Nov 29, 2021 at 3:13