Tailwind(Nativewind) css is not working with React + Vite in React-Native-Web #28399
Unanswered
cfg-deepika
asked this question in
Help
Replies: 1 comment
-
TLDR// vite.config.ts
{
plugins: [
react({
babel: {
// https://www.nativewind.dev/guides/babel-transform-only
plugins: [['nativewind/babel', { mode: 'transformOnly' }]],
},
}),
],
resolve: {
alias: {
'react-native': 'react-native-web',
},
},
}; How it worksI don't use Storybook, but I got it working by applying the
The So, all that is really needed is to ensure that the nativewind plugin is used by react babel setup and ensure that vite resolves |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Summary
Hello!
We are working with Storybook 8 with React + Vite. We are using Tailwind CSS with Nativewind. We have configured everything mentioned in the Tailwind, Nativewind, and Storybook migration/setup guide.
But TailwindCSS classes won't show up
Additional information
main.ts
preview.ts
global.css
postcss.config.js
tailwind.config.mts
vite.config.mts
dependencies versions
TextComponent.tsx
Please suggest, what we are missing here!
Create a reproduction
No response
Beta Was this translation helpful? Give feedback.
All reactions