React Native Expo 中的 NativeWind 和 TailWind 在包裹在导航容器中时不起作用

问题描述 投票:0回答:1

当组件未包装在导航容器中时,Nativewind 工作完美,但当它们被包装时,样式停止工作。是的,我已经尝试重新启动服务器并使用“expo start -c”清除缓存,但这不起作用。例如-

<View style={{ flex: 1 }}>
      <Text className="font-extrabold">
        Hello
      </Text>
      <NavigationContainer>
        <Stack.Navigator>
           <Text className="font-extrabold">
              Hello
           </Text>
        </Stack.Navigator>
      </NavigationContainer>
    </View>

NavigationContaainer 之外的文本被加粗,但不是包裹在 Navigation Container 中的文本。我曾尝试使用 NVM 尝试不同版本的 node.js。任何建议将不胜感激!

node.js react-native expo tailwind-css
1个回答
0
投票

你应该使用 NativeWind,因为 TailWind 停止支持 React Native。

如果您已经在使用 NativeWind,请停止服务器并重新启动它使用expo start -c

react-native start --reset-cache
清除缓存

© www.soinside.com 2019 - 2024. All rights reserved.