Open
Description
Steps to reproduce
Link to live example: (required) https://stackblitz.com/edit/react-ouzbqw?file=Demo.tsx
Steps:
- Set the onInputChange prop
- Check what is passed in for the event param
Current behavior
Hello 👋
I'm noticing that the onInputChange
is typed as:
onInputChange?: (
event: React.SyntheticEvent,
value: string,
reason: AutocompleteInputChangeReason,
) => void;
with a non-null event
param, but null
seems to be coming through for the param on mount. See demo:
Expected behavior
I'm not sure if onInputChange
is supposed to be called on mount or not, but if it is and it's expected that null
is an option for event
, would it be possible to update the typing of onInputChange
to reflect that?
Thanks!
Context
We are trying to use strict null safety
Your environment
See https://stackblitz.com/edit/react-ouzbqw?file=Demo.tsx - also reproduce-able in this docs demo
Search keywords: onInputChange undefined event