react-tracked icon indicating copy to clipboard operation
react-tracked copied to clipboard

[TypeScript] Unable to set propState when used with TypeScript

Open totszwai opened this issue 4 years ago • 1 comments

TypeScript is not letting me pass the props over to the useState like in your example. It doesn't like propState as well as useState when passing them over to the createContainer https://github.com/dai-shi/react-tracked/blob/main/website/docs/recipes.md#usestate-with-propstate

image

totszwai avatar Apr 21 '22 16:04 totszwai

You need to type useValue. https://codesandbox.io/s/condescending-leftpad-hlokvl?file=/src/App.tsx

dai-shi avatar Apr 21 '22 23:04 dai-shi

Closing as stale.

dai-shi avatar Mar 02 '24 01:03 dai-shi