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 keyInterface can't be null #94

Closed
Fronix opened this issue Nov 7, 2019 · 0 comments · Fixed by #96
Closed

Typescript keyInterface can't be null #94

Fronix opened this issue Nov 7, 2019 · 0 comments · Fixed by #96
Labels
bug Something isn't working

Comments

@Fronix
Copy link

Fronix commented Nov 7, 2019

Can't null the key unless I //@ts-ignore it

Argument of type 'string | null' is not assignable to parameter of type 'keyInterface'.
  Type 'null' is not assignable to type 'keyInterface'.  TS2345
  const { data: results, isValidating: loading } = useSWR(
    value ? `/api/search/autocomplete/${entity}/?query=${value}` : null,
    (url: string) => fetch(url).then(_ => _.json())
  );
@pacocoursey pacocoursey added the bug Something isn't working label Nov 7, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants