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

Question about replacing Badge's root with Badge.compose({...}) #3814

Open
2 of 6 tasks
shawnthye-guru opened this issue Nov 14, 2024 · 0 comments
Open
2 of 6 tasks

Comments

@shawnthye-guru
Copy link

Willing to submit a PR to fix?

  • I am willing to submit a PR to fix

Requested priority

High

Products/applications affected

No response

Package version(s)

0.42.3

OS version(s)

No response

Platform

  • iOS
  • macOS
  • win32
  • windows
  • android

Xcode version

No response

Please provide a reproduction of the bug

Based on the new Compose Framework and Slot docs.

I am trying to make Badge Pressable

export const PressableBadge = Badge.compose({
    slots: {
        root: Pressable,
        text: Text
    }
    // ... other code here
})

export const Usage: FC = () => {
    return (
        <PressableBadge
            // ❗❗❗TYPE ERROR❗❗❗
            onPress={() => {console.log('Badge pressed')}}
        />
    )
}

How do I make Typescript happy? or am I doing it wrong?

Actual behavior

Typescript not happy

Expected behavior

Should we have something like Badge.compose<PressableBadgeType> to override the Props?

@shawnthye-guru shawnthye-guru changed the title Question about how to replace Badge's root with Badge.compose() Question about replacing Badge's root with Badge.compose({...}) Nov 14, 2024
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

No branches or pull requests

1 participant