【问题标题】:Tailwind CSS not working with React NativeTailwind CSS 不适用于 React Native
【发布时间】:2022-03-20 10:37:48
【问题描述】:

我正在使用以下代码,但应用程序中没有顺风类的影响。任何帮助都将是可观的。

import React from 'react';
import {Text, View } from 'react-native';
import {useTailwind} from 'tailwind-rn';

export default function App() {
  const tailwind = useTailwind();
  return (
    <View style={tailwind("flex-1 justify-center items-center")}>
      <Text>Welcome to React-Native!</Text>
    </View>
  );
}

【问题讨论】:

  • 首先安装 npm i tailwind-rn 第二个用于自动设置 npx setup-tailwind-rn 然后像下面这样用尾风包裹根组件

标签: react-native tailwind-css


【解决方案1】:

首先安装 npm i tailwind-rn 第二个用于自动设置 npx setup-tailwind-rn 然后像下面这样用尾风包裹根组件

现在你可以使用顺风

【讨论】:

  • 好的 Aniket。会试一试的。
猜你喜欢
  • 2021-09-04
  • 1970-01-01
  • 2023-01-26
  • 2022-10-23
  • 2022-10-08
  • 2021-02-14
  • 2022-01-20
  • 2022-10-22
  • 1970-01-01
相关资源
最近更新 更多