M
M
maratt2020-01-28 14:03:37
typescript
maratt, 2020-01-28 14:03:37

How to properly describe input in ts event?

<input onKeyUp={onKeyUp} />

const onKeyUp = (e) => {
    if (e.keyCode === 13) {
      e.target.blur();
    }
  };


how to describe the onKeyUp function using ts correctly?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
R
Robur, 2020-01-28
@maratt

go to the onKeyUp description and look at the method signature.
there will also be an event type that you can use at your place

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question