Type issues when using createStore
in TS
#2837
Unanswered
motistudio
asked this question in
General
Replies: 1 comment
-
Thanks for reporting. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hi
I've noticed a type issue when using
createStore
in a TS environment.Whenever it's used, the following error appears:
TS config
I think it can be fixed by tweeking the
module
&moduleResolution
, but that's not possible for every project.In my case it's:
Solution
The solution is to just export the
Store
type, allowing the type "to be named".I think it's useful anyhow, since users who use
createStore
might need to describe it as a type as well.A wider solution would be to not use the
export ... from '...'
syntax, it seems that it's the primary case of this specific error across different packages.--
Thank you!
Loves this library
Beta Was this translation helpful? Give feedback.
All reactions