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 error - must have a '[Symbol.iterator]()' method that returns an iterator. #342

Closed
pauloendoh opened this issue Feb 18, 2023 · 2 comments · Fixed by #349
Closed

Comments

@pauloendoh
Copy link

pauloendoh commented Feb 18, 2023

The following code show this typescript error:

Type '() => [number, Dispatch<SetStateAction>, boolean, string]' must have a 'Symbol.iterator' method that returns an iterator.

 const [value, setValue, isPersistent, error] = useChromeStorageLocal(
    'counterLocal',
    0
  )

If I put a @ts-expect-error before the line, it runs ok, but the values won't be typed.

@onikienko
Copy link
Owner

Thank you for reporting @pauloendoh
The community supports typing. Typescript is not my language.
It will be great if you create PR with a fix.

@vinicoder
Copy link
Contributor

vinicoder commented Feb 27, 2023

Hey, guys! @onikienko @pauloendoh

I made this PR to fix it. Can you please review it? #349

I would love to use this library, and this is the only thing missing from me.

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

Successfully merging a pull request may close this issue.

3 participants