Closed
Description
Steps to reproduce
Link to live example: https://stackblitz.com/edit/react-d4b5ls?file=Demo.tsx
Steps:
- Set the
onHighlightChange
prop - Check what is passed in for the
event
param
Current behavior
Hello 👋
I'm noticing that the onHighlightChange
is typed as:
onHighlightChange?: (
event: React.SyntheticEvent,
option: Value | null,
reason: AutocompleteHighlightChangeReason,
) => void;
with a non-null event
param, but undefined
seems to be coming through for the param. See demo:
Expected behavior
Would it be possible to change the typing of the prop to reflect the values that are being passed to event
?
- event: React.SyntheticEvent,
+ event: React.SyntheticEvent | undefined,
This seems like it would be consistent with some other onHighlightChange props.
Context
We are trying to use strict null safety
Your environment
See codesandbox link
Search keywords: onHighlightChange, undefined event