We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
downshift
node
npm
Relevant code or config
const { // ... } = useCombobox({ // ... onInputValueChange: async ({ inputValue: changedInputValue }) => { const response = await fetchApi( `/search-results?q=${changedInputValue}`, { method: 'GET', }, ); if ('errors' in response) { return; } setResults(response.results); }, });
What you did:
Use async function in option for hook (in my case, useCombobox)
useCombobox
What happened:
The @typescript-eslint/no-misused-promises ESLint rule shows a misused promise:
@typescript-eslint/no-misused-promises
Promise-returning function provided to property where a void return was expected. eslint (@typescript-eslint/no-misused-promises)
Reproduction repository:
--
Problem description:
The types for useCombobox don't allow for async functions with event handler options:
downshift/typings/index.d.ts
Lines 582 to 588 in ee2a828
Suggested solution:
Change the return type of the event handler function types from void to void | Promise<void>
void
void | Promise<void>
The text was updated successfully, but these errors were encountered:
No branches or pull requests
downshift
version: 9.0.6node
version: 20.15.0npm
version: 10.7.0Relevant code or config
What you did:
Use async function in option for hook (in my case,
useCombobox
)What happened:
The
@typescript-eslint/no-misused-promises
ESLint rule shows a misused promise:Reproduction repository:
--
Problem description:
The types for
useCombobox
don't allow for async functions with event handler options:downshift/typings/index.d.ts
Lines 582 to 588 in ee2a828
Suggested solution:
Change the return type of the event handler function types from
void
tovoid | Promise<void>
The text was updated successfully, but these errors were encountered: