-
-
Notifications
You must be signed in to change notification settings - Fork 72
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 is not happy with react-tracked. What am I missing here? #59
Comments
Hi, I'm not sure if I understand how this is happening. Would it possible to create a reproduction, possibly with codesandbox. One thing in mind is |
I'm so happy with this Project. If you want, I can move it to typescript and have better types. because most of my projects are ts. Is it OK to take the PR and change all the files to real ts? |
@Aslemammad Hey, thanks for volunteering! Actually, I already developed v2 in all TS. #43 In that sense, we shouldn't spend too much effort for v1. I think we can just modify the current index.d.ts in v1 to fix the issue reported here. Do you know what the issue is? I wonder if @clechner77 is still around. |
OOOh thanks, Maybe I'll take the other issues. |
eb0c9d7 changed it to |
Sorry, I am alive!!!! Long story.... Simple change to FC may be all that's needed. |
Published: https://www.npmjs.com/package/react-tracked/v/1.4.2 I'm not quite sure if this resolves the issue described here, but let me close this. Feel free to reopen this if the problem persists. |
Ideas how to work around this with Provider?
(alias) const Provider: React.ComponentType
import Provider
JSX element type 'ReactElement<any, any> | Component<unknown, any, any>' is not a constructor function for JSX elements.
Type 'Component<unknown, any, any>' is not assignable to type 'Element | ElementClass'.
Type 'Component<unknown, any, any>' is not assignable to type 'ElementClass'.
The types returned by 'render()' are incompatible between these types.
Type 'ReactNode' is not assignable to type 'false | Element'.
Type 'string' is not assignable to type 'false | Element'.ts
The text was updated successfully, but these errors were encountered: