Skip to content

Pass through props on web #494

Open
Open

Description

@cmaycumber

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} />;
}

Activity

  1. changed the title [-]Pass `className` as prop on web[/-] [+]Pass through props on web[/+] on Sep 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions