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

Readme code example doesn't work. #1354

Closed
swbrenneis opened this issue Jan 18, 2022 · 3 comments · Fixed by #1444
Closed

Readme code example doesn't work. #1354

swbrenneis opened this issue Jan 18, 2022 · 3 comments · Fixed by #1444

Comments

@swbrenneis
Copy link

  • downshift version: 6.1.7
  • node version: 16.11.0
  • npm (or yarn) version: yarn 1.22.15

Relevant code or config

The code is from the example in the readme

What you did:

Tried to use the example code

What happened:

Does not compile.
{...getRootProps({}, {suppressRefError: true})} is invalid since the first argument has a required field, refKey.
The argument seems to be a GetRootPropsOptions interface, but there is no documentation of what is
in that interface or what the required field is.

Reproduction repository:

Problem description:

Unable to use the readme example as a starter.

Suggested solution:

Document the GetRootPropsOptions interface. Fix the readme example.

@evenfrost
Copy link

Any update on this? Just stumbled upon this when trying Downshift in my TS project.

@silviuaavram
Copy link
Collaborator

Why not use useCombobox?

@silviuaavram
Copy link
Collaborator

https://github.com/downshift-js/downshift#getrootprops The documentation is here. The type not being optional in TS is relevant and should be fixed. Thank you!

On the other hand, you should use useCombobox since it aims to provide ARIA 1.2 combobox pattern support.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants