Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Typescript types incompatible on examplecode #847

Open
gmuc opened this issue Mar 7, 2024 · 0 comments
Open

Typescript types incompatible on examplecode #847

gmuc opened this issue Mar 7, 2024 · 0 comments
Labels

Comments

@gmuc
Copy link

gmuc commented Mar 7, 2024

Usage questions

I had installed your demo code like you describe it and run the file react-bootstrap-typeahead/example/index.html.
It work like on your live demo!

But if I look in the code of examples/CustomFilteringExample.tsx with my VS Code there is a typescript error.

The text:

Type '((option: Option, props: any) => boolean) | string[]' is not assignable to type 'string[] | FilterByCallback | undefined'.
Type '(option: Option, props: any) => boolean' is not assignable to type 'string[] | FilterByCallback | undefined'.
Type '(option: Option, props: any) => boolean' is not assignable to type 'FilterByCallback'.
Types of parameters 'option' and 'option' are incompatible.
Type 'import("/Users/gerdmucha/projekte/wetter/cirrus23/test_typeahead/node_modules/react-bootstrap-typeahead/types/types").Option' is not assignable to type 'import("/Users/gerdmucha/projekte/wetter/cirrus23/test_typeahead/react-bootstrap-typeahead/example/src/data").Option'.
Type 'string' is not assignable to type 'Option'.ts(2322)
types.d.ts(36, 5): The expected type comes from property 'filterBy' which is declared here on type 'IntrinsicAttributes & TypeaheadComponentProps & RefAttributes'

How can I fix this?

Version v6.3.2

Steps to reproduce

Looking code of examples/CustomFilteringExample.tsx with my VS Code

@gmuc gmuc added the bug label Mar 7, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant