OiO.lk Community platform!

Oio.lk is an excellent forum for developers, providing a wide range of resources, discussions, and support for those in the developer community. Join oio.lk today to connect with like-minded professionals, share insights, and stay updated on the latest trends and technologies in the development field.
  You need to log in or register to access the solved answers to this problem.
  • You have reached the maximum number of guest views allowed
  • Please register below to remove this limitation

Automatically inferring correct type in Zustand with Typescript

  • Thread starter Thread starter Re-Angelo
  • Start date Start date
R

Re-Angelo

Guest
I am following an example from Zustand with Typescript.

I get the error "TS7044: Parameter by implicitly has an any type, but a better type may be inferred from usage."

I know I can turn of this rule in eslint/ts-config but I figured the whole point of Typescript is not to have "any" leak into your code base.

Has anyone been able to figure out how to get it to automatically infer the correct type? I've also tried using the combine() method but no luck still.

enter image description here

<p>I am following an example from Zustand with Typescript.</p>
<p>I get the error "TS7044: Parameter by implicitly has an any type, but a better type may be inferred from usage."</p>
<p>I know I can turn of this rule in eslint/ts-config but I figured the whole point of Typescript is not to have "any" leak into your code base.</p>
<p>Has anyone been able to figure out how to get it to automatically infer the correct type?
I've also tried using the combine() method but no luck still.</p>
<p><a href="https://i.sstatic.net/198q6Ai3.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/198q6Ai3.png" alt="enter image description here" /></a></p>
 

Latest posts

D
Replies
0
Views
1
Danish Karmally
D
Top