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

[TS]: Error for withSafeAreaInsets due to @types/react forwardRef update #526

Closed
akuul opened this issue Sep 3, 2024 · 4 comments · Fixed by #528
Closed

[TS]: Error for withSafeAreaInsets due to @types/react forwardRef update #526

akuul opened this issue Sep 3, 2024 · 4 comments · Fixed by #528

Comments

@akuul
Copy link
Contributor

akuul commented Sep 3, 2024

Hello,

just bringing awareness here that due to @types/react^18.3.5 and changes made to the forwardRef function, withSafeAreaInsets is throwing a Typescript error.

Argument of type '(props: T, ref: React.Ref<unknown>) => React.JSX.Element' is not assignable to parameter of type 'ForwardRefRenderFunction<unknown, PropsWithoutRef<T>>'.
  Types of parameters 'props' and 'props' are incompatible.
    Type 'PropsWithoutRef<T>' is not assignable to type 'T'.
      'T' could be instantiated with an arbitrary type which could be unrelated to 'PropsWithoutRef<T>'.

I have patched T to use PropsWithoutRef<T> that resolves the issue, but this is temporary solution as it is not compatible with @types/react^18.3.4

@abrah4mr
Copy link

abrah4mr commented Sep 5, 2024

Same error here, is there any solution to this @janicduplessis?

@jacobp100
Copy link
Collaborator

If you can submit a PR that fixes the issue without breaking older versions, we’ll merge. Otherwise, you could also open an issue on the react types package as to why it broke other packages

@abrah4mr
Copy link

abrah4mr commented Sep 5, 2024

So, this is a issue related with react types? @jacobp100

@abrah4mr
Copy link

abrah4mr commented Sep 5, 2024

Also, is happening on older versions too, I have currently the 4.7.4 in my project.

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

Successfully merging a pull request may close this issue.

3 participants