Pressable styling doesn't work with native-wind

146 Views Asked by At

I'm using react-native with nativewind library and conditional styling in Pressable doesn't work when it's wrapped in a View with nativewind classnames.
So basically removing the className from the wrapper View make the Pressable styling work (background color toggle).
Why is this happening? :(

     <View className="flex-row basis-8/12 gap-x-2">
          <Pressable
            style={({ pressed }) => [
              {
                backgroundColor: pressed ? 'black' : 'white',
              },
            ]}>
            <Text>Select</Text>
          </Pressable>
        </View>
0

There are 0 best solutions below