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

Type errors when adding Heading component #2463

Open
1 of 6 tasks
mnemitz opened this issue Sep 10, 2024 · 0 comments
Open
1 of 6 tasks

Type errors when adding Heading component #2463

mnemitz opened this issue Sep 10, 2024 · 0 comments
Labels
bug Something isn't working v2 gluestack-ui v2

Comments

@mnemitz
Copy link

mnemitz commented Sep 10, 2024

Description

Adding the Heading component results in type errors on forwarded refs

CodeSandbox/Snack link

https://codesandbox.io/p/devbox/hrlzf2

Steps to reproduce

  1. Set up project with expo@51.0.28 (should have "@expo/html-elements": "^0.4.2")
  2. Set up Gluestack with npx gluestack-ui@latest init
  3. Run npx gluestack-ui@latest add heading
  4. See TS error on line 54 of components/ui/heading/index.tsx:
Type 'ForwardedRef<typeof Text | Component<TextProps, any, any>>' is not assignable to type 'LegacyRef<typeof Text> | undefined'.
  Type 'MutableRefObject<typeof Text | Component<TextProps, any, any> | null>' is not assignable to type 'LegacyRef<typeof Text> | undefined'.
    Type 'MutableRefObject<typeof Text | Component<TextProps, any, any> | null>' is not assignable to type 'RefObject<typeof Text>'.
      Types of property 'current' are incompatible.
        Type 'typeof Text | Component<TextProps, any, any> | null' is not assignable to type 'typeof Text | null'.
          Property 'prototype' is missing in type 'Component<TextProps, any, any>' but required in type 'typeof Text'.ts(2322)

gluestack-ui Version

3.3.1

Platform

  • Expo
  • React Native CLI
  • Next
  • Web
  • Android
  • iOS

Other Platform

No response

Additional Information

No response

@mnemitz mnemitz added the bug Something isn't working label Sep 10, 2024
@sra1kumar-NULL sra1kumar-NULL removed their assignment Sep 10, 2024
@Viraj-10 Viraj-10 added the v2 gluestack-ui v2 label Sep 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working v2 gluestack-ui v2
Projects
Status: Backlog
Development

No branches or pull requests

3 participants