Skip to content

[V5] 'style' property breaks nativewind className style #239

@arnaudpfu

Description

@arnaudpfu

In nativewind V5, I don't achieve to make 'className' and 'style' properties both working for the same component.

Here everything works :

  <View className="flex-1 items-center justify-center bg-amber-500">
    <Text className="text-2xl font-bold text-blue-500">
      Welcome to Nativewind!
    </Text>
  </View>

Here the nativewind classNames of the parent View aren't applied :

  // only style={{...}} works, className is ignored
  <View className="flex-1 items-center justify-center bg-amber-500" style={{}}> 
    {/* it works for the children */}
    <Text className="text-2xl font-bold text-blue-500">
      Welcome to Nativewind!
    </Text>
  </View>

I haven't found similar issue on the web.
Does anyone else have the same issue ?

Reproduction
https://github.com/nativewind/nativewind/

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions