How to use nativewind with @rneui/themed ? #3800
|
I am using nativewind and Expo Go for development and testing, and I have have the following code snippet: import { View, Text } from "react-native"
import { Text as Text2 } from "@rneui/themed"
<View>
<Text className="text-red-600">Email</Text>
<Text2 className="text-red-600">Email</Text2>
</View>I expect both text to appear red in color according to the nativewind utility. However, only the react-native Text is in red and Text2 is in black. Is it possible to use nativewind with react-native-elements at all? If so, how can I do it? Thanks in advance. |
Replies: 2 comments 1 reply
|
https://www.nativewind.dev/guides/custom-components#passing-styles-to-components Unless third-party component libraries (like RNE) explicitly implement the support for it, To support Nativewind, we need to explicitly pass down any additional props (like |
https://www.nativewind.dev/guides/custom-components#passing-styles-to-components
Unless third-party component libraries (like RNE) explicitly implement the support for it,
classNamedoes not get passed down to the child native component. RNE is just a wrapper over the actual native components. You can refer to the source file of each component to understand better.To support Nativewind, we need to explicitly pass down any additional props (like
className) to the child component. This needs to be added as a new enhancement PR. You can refer to https://www.nativewind.dev/v4/guides/third-party-components for more details.