You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Do you want to request a feature or report a bug?
Bug
What is the current behavior?
I am trying to use the lib with TypeScript and getting an error related to KeyboardEventHandler:
Types of property 'onKeyDown' are incompatible.
Type 'KeyboardEventHandler<Element>' is not assignable to type 'KeyboardEventHandler<HTMLInputElement>'.
Types of parameters 'event' and 'event' are incompatible.
Property 'code' is missing in type 'KeyboardEvent<HTMLInputElement>' but required in type 'KeyboardEvent<Element>'
If the current behavior is a bug, please provide the steps to reproduce and if possible a minimal demo of the problem.
Just following the docs is throwing this compilation error for the input element.
What is the expected behavior?
Changing onKeyDown: React.KeyboardEventHandler to onKeyDown: React.KeyboardEventHandler<HTMLInputElement> seems to work properly and compile.
Which versions of ReactPlacesAutocomplete, and which browser / OS are affected by this issue?
"react-places-autocomplete": "^7.3.0",
"@types/react-places-autocomplete": "^7.2.8",
The text was updated successfully, but these errors were encountered:
Having the same issue. The bug seems to happen with @types/react and @types/react-dom present in the package.json. Removing these dependencies solves the problem. Another way of solving is to upgrade React and these @types packages to React 17
Having the same issue. The bug seems to happen with @types/react and @types/react-dom present in the package.json. Removing these dependencies solves the problem. Another way of solving is to upgrade React and these @types packages to React 17
Do you want to request a feature or report a bug?
Bug
What is the current behavior?
I am trying to use the lib with TypeScript and getting an error related to KeyboardEventHandler:
If the current behavior is a bug, please provide the steps to reproduce and if possible a minimal demo of the problem.
Just following the docs is throwing this compilation error for the
input
element.What is the expected behavior?
Changing
onKeyDown: React.KeyboardEventHandler
toonKeyDown: React.KeyboardEventHandler<HTMLInputElement>
seems to work properly and compile.Which versions of ReactPlacesAutocomplete, and which browser / OS are affected by this issue?
"react-places-autocomplete": "^7.3.0",
"@types/react-places-autocomplete": "^7.2.8",
The text was updated successfully, but these errors were encountered: