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
Following the example in the docs, I'm trying to set selectItem to null on an action triggered by the user (click an X button for the item previously selected + rendered on the page to remove it)
What happened:
The action works as expected, but Typescript errors, stating we can't pass null to selectItem: Argument of type 'null' is not assignable to parameter of type 'Item'.ts(2345)
Problem description:
Tracing the previous thread issue 1088, it seems like we allow selectedItem to be null and various arguments within onChange, onSelect, etc. but selectItem is strictly typed against Item
Suggested solution:
Update selectItem to also accept null as an argument
The text was updated successfully, but these errors were encountered:
downshift
version: 6.1.7node
version: 14.15.4npm
(oryarn
) version: 1.22.19Relevant code or config
What you did:
selectItem
tonull
on an action triggered by the user (click an X button for the item previously selected + rendered on the page to remove it)What happened:
null
toselectItem
:Argument of type 'null' is not assignable to parameter of type 'Item'.ts(2345)
Problem description:
selectedItem
to benull
and various arguments withinonChange
,onSelect
, etc. butselectItem
is strictly typed againstItem
Suggested solution:
selectItem
to also acceptnull
as an argumentThe text was updated successfully, but these errors were encountered: