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

Pass through props on web #494

Open
cmaycumber opened this issue Sep 16, 2024 · 0 comments
Open

Pass through props on web #494

cmaycumber opened this issue Sep 16, 2024 · 0 comments
Labels
enhancement New feature or request

Comments

@cmaycumber
Copy link

cmaycumber commented Sep 16, 2024

I understand this might not be ideal but it would help with styling when using nativewind.

Updated example of why this currently won't work:

// ❌ This component will not work with NativeWind
// This component is 'picking' the props. 
// Any props that are not explicitly defined will not be passed down
function ThirdPartyComponent({ style }) {
  return <View style={style} />;
}


// ✅ This component will work with NativeWind
function ThirdPartyComponent({ style, ...props }) {
  return <View style={style} {...props} />;
}
@cmaycumber cmaycumber changed the title Pass className as prop on web Pass through props on web Sep 16, 2024
@tomekzaw tomekzaw added the enhancement New feature or request label Sep 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants