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

setState(value) not being recognized as proper input by TypeScript #4

Open
skokenes opened this issue Jan 23, 2019 · 0 comments
Open

Comments

@skokenes
Copy link

skokenes commented Jan 23, 2019

I have a value that is of type Profunctor:
const testProf = useProfunctorState("foo");

With this setup, I have no problem updating the state with function, like
testProf.setState(() => "bar")

However, if I try to use a new value instead of a function, TypeScript throws an error. For example, if I write testProf.setState("bar"), TypeScript says "Argument of type '"bar"' is not assignable to parameter of type 'Updater'. "

I'm relatively new to TS so I am not sure how to fix this in the package source. Any suggestions would be appreciated.

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

1 participant