When handling the onChange event the currentTarget is null.
You can see an example on webpackbin here:
<DebounceInput
minLength={2}
debounceTimeout={300}
onChange={event => {
console.log("target =", event.target);
console.log("target.value =", event.target.value);
console.log("currentTarget =", event.currentTarget);
}} />
Which gives you the following output after typing "test":
target = <input type="text" value data-reactid=".0.0">
target.value = test
currentTarget = null
I take it this is because the event is stored then re-dispatched later, and React nulls out the currentTarget after the initial dispatch. However this is not what I would expect because its not how the event argument normally works, you expect currentTarget to be the target you added the handler to.
When handling the
onChangeevent thecurrentTargetisnull.You can see an example on webpackbin here:
Which gives you the following output after typing "test":
I take it this is because the event is stored then re-dispatched later, and React nulls out the
currentTargetafter the initial dispatch. However this is not what I would expect because its not how the event argument normally works, you expectcurrentTargetto be the target you added the handler to.