2

I am using the below code but there's no effect of tailwind classes in the app. Any help will be appreaciable.

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>
  );
}
2
  • first install npm i tailwind-rn second for automatic setup npx setup-tailwind-rn Then wrap the root component with tailwind like below Commented Feb 15, 2022 at 7:53
  • Refer this link github.com/vadimdemedes/tailwind-rn Commented Mar 3, 2022 at 10:23

1 Answer 1

2

first install npm i tailwind-rn second for automatic setup npx setup-tailwind-rn Then wrap the root component with tailwind like below

enter image description here

now you can use tailwind

Sign up to request clarification or add additional context in comments.

3 Comments

Okay Aniket. Will give it a try.
where is the utilities coming from ?
@KrishnaAcharya import utilities from './tailwind.json'; Follow the instructions: npmjs.com/package/tailwind-rn

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.