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 / code sandbox example #20

Open
tony opened this issue Mar 11, 2022 · 2 comments
Open

Typescript / code sandbox example #20

tony opened this issue Mar 11, 2022 · 2 comments

Comments

@tony
Copy link

tony commented Mar 11, 2022

Thank you for the project!

I have a bug setting up (typescript 4.3.5, use-query-string 2.4.1, query-string 6.12.0) but think it'd be most efficient if I could give a shot recreating it in a codesandbox to give a reproducible example / isolate it more

TS2488: Type 'QueryStringResult' must have a '[Symbol.iterator]()' method that returns an iterator.
    147 | const HeaderComponent = ({ onPropClicked }: Props) => {
  > 148 |   const [query, setQuery] = useQueryString(window.location, updateQuery)
@1pone
Copy link

1pone commented Jun 28, 2022

same

@slaurent22
Copy link

I was able to workaround this error via the following:

  import useQueryString, { QueryStringResult } from "use-query-string";

  const [query, setQuery] = useQueryString(window.location, updateQuery) as [
    QueryStringResult[0],
    QueryStringResult[1]
  ];

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

No branches or pull requests

3 participants