Override Downshift ID

182 views Asked by At

I'm trying to override the default ids that Downshift provides.

I tried passing the id through getInputProps() like the docs suggest but it did not work.

{...getInputProps({ inputId: 'my-input-id' })}

Passing the id directly to the input did not work as well.

<input id='my-input-id />

In both cases, the id remains downshift-0-input. Any ideas on how I can override this id?

1

There are 1 answers

0
KevinH On

Seems like the documentation is wrong. However the TypeScript types are correct and I just tested and simply passing id works:

{...getInputProps({ id: 'my-input-id' })}