Add Tailwind CSS In Your React Native App

แชร์
ฝัง
  • เผยแพร่เมื่อ 8 มิ.ย. 2024
  • Hello everyone, today's video is about how you can add tailwind css into your react native app, I'm going to show you two methods to integrate tailwind into react native app.
    make sure you like this video and subscribe the channel for more react native videos.
    Github repo: github.com/syednomishah/React...
    React Native : reactnative.dev
    First Method (TWRNC) : www.npmjs.com/package/twrnc?a...
    Second Method (NativeWind) : www.nativewind.dev
    Tailwind CSS classes cheatsheet : nerdcave.com/tailwind-cheat-s...
    Add Navigation in React Native : • Food Delivery App with...
    If you appreciate my work and you would like to support my channel: www.buymeacoffee.com/syednoman
    🚨 more videos on react native:
    Food Recipe App with Reanimated : • 🔴 Build Food Recipe Ap...
    AI Voice Assistant with ChatGPT & DALL-E : • 🔴 Build a React Native...
    Weather App : • 🔴 Build Weather App Us...
    Movie App : • 🔴 Build Movie App Usin...
    Coffee App UI: • 🔴 Coffee App UI - Reac...
    TH-cam Clone App: • 🔴 TH-cam Clone - Reac...
    Login | SignUp UI : • 🔴 Login | SignUp UI - ...
    Fast Food App : • 🔴 Fast Food App UI - R...
    App Store UI : • 🔴 App Store UI - React...
    Fruit Shop UI : • 🔴 Fruit Shop UI - Reac...
    Firebase Authentication React Native: • React Native Firebase ...
    Food Delivery App : • Food Delivery App with...
    Learn React Native: • Build Expensify App Wi...
    Learn Reactjs: • Modern React For Begin...
    #expo #reactnative #tailwindcss #javascript #programming #typescript #speedcode #coding #design #appdevelopment #reactjs #ui #uiux #reactnavigation #reactnativetutorial #react #animation #reactjs #navigation #navigationbar #uidesign #mobiledevelopment #iosdeveloper #buildinpublic #opensource #reactnativeapp #reactjstutorial #typescript
    react native animations
    animations in react native
    react native tutorial
    react native app
    react native tutorial for beginners
    react native project
    react native course
    add tailwind css in react native
    react native ui
    ▬▬▬▬ Contents of this video ▬▬▬▬▬▬▬▬▬▬
    00:00 - Intro
    00:18 - Create React Native App
    01:32 - First Method (TWRNC)
    04:24 - Second Method (NativeWind)

ความคิดเห็น • 108

  • @codewithnomi
    @codewithnomi  10 หลายเดือนก่อน +30

    you may face this error with newer version of tailwindcss.
    Error: Use process(css).then(cb) to work with async plugins]
    To fix this error just downgrade your tailwindcss version, run this command:
    npm i --dev tailwindcss@3.3.2
    If you are using yarn then run this command:
    yarn add --dev tailwindcss@3.3.2

    • @sdk_gyan
      @sdk_gyan 10 หลายเดือนก่อน

      how to setup dark and light mode

    • @codewithnomi
      @codewithnomi  10 หลายเดือนก่อน

      @@sdk_gyan will create a tutorial on this 😉

    • @MovieKaliReactions
      @MovieKaliReactions 9 หลายเดือนก่อน

      bro I have struggled for ages to solve this , i was about to give up
      @lets connect brother am a react native dev too

    • @chintype91
      @chintype91 9 หลายเดือนก่อน

      Thanks a lot, but i had the one issue with react-navigation. It didn't work

    • @codewithnomi
      @codewithnomi  9 หลายเดือนก่อน

      @@chintype91 th-cam.com/video/-Kr247pr9hQ/w-d-xo.html

  • @user-qx8kb7xx9x
    @user-qx8kb7xx9x 3 หลายเดือนก่อน

    So simple! Thank you very much

  • @abdullahzafar8886
    @abdullahzafar8886 11 หลายเดือนก่อน +3

    Very mesmerising listening to your voice today ❤

  • @hamzaeshoul
    @hamzaeshoul 6 หลายเดือนก่อน +2

    Great tutorial. Thank you very much sir !

    • @codewithnomi
      @codewithnomi  6 หลายเดือนก่อน +1

      Thank you ❤️

  • @salmanhamza4202
    @salmanhamza4202 11 หลายเดือนก่อน

    i was waiting for it

  • @aneneemmanuel7985
    @aneneemmanuel7985 8 หลายเดือนก่อน +4

    If you're runnig Expo on ANDROID and you're having issues adding the shadows, use this:
    For TailwindCSS (only):
    style={[tw`bg-teal-500 p-4 rounded-lg`, Platform.OS === 'android' && { elevation: 20 }]}
    For NativeWind & TailwindCSS:
    className="bg-teal-500 p-4 rounded-lg" style={[Platform.OS === 'android' && { elevation: 20 }]}
    Thanks for sharing, Nomi. Nice Tutorial.

  • @user-sx7ri3fk6t
    @user-sx7ri3fk6t 3 หลายเดือนก่อน

    Thanks a lot man, solved my nighmare in just minutes... stay blessed.
    :)

  • @ChungKang
    @ChungKang 4 หลายเดือนก่อน

    Awesome, thanks!

  • @JuanMolina-tl2xc
    @JuanMolina-tl2xc 4 หลายเดือนก่อน +1

    I love you brother... Thank you

  • @yuliav4682
    @yuliav4682 10 หลายเดือนก่อน +1

    thank you dude)

  • @ghayoorhussain8930
    @ghayoorhussain8930 11 หลายเดือนก่อน +1

    Thanks, a lot.

  • @shahmeergull2040
    @shahmeergull2040 5 หลายเดือนก่อน +1

    bro it works well with first method but when i try to switch on 2nd method using on cli it just dont apply classes added on elements you know how to fix it?

  • @brienaustinclayton
    @brienaustinclayton 9 หลายเดือนก่อน +1

    Hey , sir
    I am not able to use colors like bg-teal-200 or whatever color

  • @alimardan2665
    @alimardan2665 4 หลายเดือนก่อน

    dude ur awesome

  • @Thunderstormplus
    @Thunderstormplus 11 หลายเดือนก่อน +1

    Thanks =)

  • @whatsgoingonworld7556
    @whatsgoingonworld7556 9 หลายเดือนก่อน +1

    Thanks

  • @ridamnibjia
    @ridamnibjia 20 วันที่ผ่านมา

    if you're using the nativewind css and opening the app in web then in the App.js add this after the import:
    import { NativeWindStyleSheet } from "nativewind";
    NativeWindStyleSheet.setOutput({
    default: "native",
    });

  • @aneneemmanuel7985
    @aneneemmanuel7985 4 หลายเดือนก่อน +2

    I don't know if this'll help anyone but I noticed (ON MY COMPUTER) that if I install method 1 before installing method 2, then method 2 won't work at all (i.e. I won't be able to use className= "..."
    To fix this, I only install "NativeWind" first (or alone). If I want to install both NativeWind & twrnc, I'll install NativeWind first and then later, I'll install twrnc.
    I don't know if this is a general issue but maybe it'll save someone's time while coding. Thanks, Nomi.

  • @MrGamalin
    @MrGamalin 11 หลายเดือนก่อน

    Do a video on implementation of RTL and LRT with Tailwind CSS

  • @kntbruh
    @kntbruh 4 หลายเดือนก่อน

    thanks a lot

  • @ZaminHesenov
    @ZaminHesenov 9 หลายเดือนก่อน +1

    If it was received, I would give you 10000000 likes thank youuuu

  • @tundeakinola8122
    @tundeakinola8122 9 หลายเดือนก่อน +3

    I have tried using it with typescript tsx file but it was giving error with the ClassName getting red lines.. How does one solve it??

    • @dusekdan
      @dusekdan 3 หลายเดือนก่อน

      className - no capital C.

  • @rangga1204
    @rangga1204 6 หลายเดือนก่อน +3

    thanks for the tutorial, but it does not work on CLI

  • @supercica
    @supercica 9 หลายเดือนก่อน +2

    Hi Nomi, thank you for this video. I did this app and I tried to build .apk with expo eas. In development everything works but when I install .apk to Android phone, it starts, it opens expo splash screen and then just shuts down. There is no errors or any log and I can not find what is the problem. Have you ever had this situation. Do you have any advice for me? Thank you. And again thanks so much for these videos.

  • @haseebshabir1970
    @haseebshabir1970 10 หลายเดือนก่อน +2

    Sir I'm following all the steps as you shown in video but at the end i got error and when i search this error on stack overflow it suggests me to downgrade the tailwind css version when i do so its classes only work in app. Js file not in other files. Please help me I'm stuck here very badly

    • @codewithnomi
      @codewithnomi  10 หลายเดือนก่อน

      you need to specify other files directory in the contents property of tailwind config file, this may solve the issue

    • @haseebshabir1970
      @haseebshabir1970 10 หลายเดือนก่อน

      @@codewithnomi sir I've done that but it is not working

  • @abdullahzafar8886
    @abdullahzafar8886 11 หลายเดือนก่อน

    MashaAllah shah g i miss u so much

    • @codewithnomi
      @codewithnomi  11 หลายเดือนก่อน

      me too bro 🥰

  • @haidarDevDiary
    @haidarDevDiary 11 หลายเดือนก่อน

    Boss 👍

  • @chamaldezilva
    @chamaldezilva 11 หลายเดือนก่อน +2

    Is it possible to add the conditional styles using nativewind? If yes how can I do that?

    • @codewithnomi
      @codewithnomi  11 หลายเดือนก่อน

      yes
      className={ condition? "style1" : "style2" }

    • @chamaldezilva
      @chamaldezilva 11 หลายเดือนก่อน +1

      @@codewithnomi thank you!

  • @JavierDiaz-jh7ly
    @JavierDiaz-jh7ly 8 หลายเดือนก่อน +2

    Nice tutorial. I'm facing an issue with text colors. When I change the className to modify the background color, size, or other properties, it works. However, when I try to change the text color, it's the only property that doesn't seem to work. I'm using Tailwind CSS version 3.3.2 because version 3.3.3 breaks everything.

    • @codewithnomi
      @codewithnomi  8 หลายเดือนก่อน

      thats very strange!!
      it should work because I'm currently using this in a project.

    • @prateekpuri796
      @prateekpuri796 6 หลายเดือนก่อน

      Hi DId you get the solution for ir. I am also facing same issue.

    • @JavierDiaz-jh7ly
      @JavierDiaz-jh7ly 6 หลายเดือนก่อน

      @@prateekpuri796 I tried downgrading the tailwind version but doesn't works. So finally I made it without tailwind, just css

    • @prateekpuri796
      @prateekpuri796 6 หลายเดือนก่อน +1

      I found the issue, the issue is with the exp web only and it works just fine with expo go app on my android device

    • @prateekpuri796
      @prateekpuri796 6 หลายเดือนก่อน

      Expo web*

  • @JoDaniel_Keys
    @JoDaniel_Keys 2 หลายเดือนก่อน

    i am unable to add shadow

  • @gangulyyadav2555
    @gangulyyadav2555 11 หลายเดือนก่อน +1

    does it only work with expo projec?

    • @codewithnomi
      @codewithnomi  11 หลายเดือนก่อน

      the setup process is the same for both expo and cli

  • @Slayzan
    @Slayzan 11 หลายเดือนก่อน +1

    Could you make a tutorial where you explain how to get virtual phone device like you on the right ?

    • @codewithnomi
      @codewithnomi  11 หลายเดือนก่อน

      sure, I will make a video on this someday 😉

    • @zaidshaikh2449
      @zaidshaikh2449 8 หลายเดือนก่อน

      We are still waiting for this video@@codewithnomi

  • @albinholmgren9045
    @albinholmgren9045 10 หลายเดือนก่อน +1

    the expo gives me error: "use process(css).then(cb)"
    do you know what it might be and how to solve it?

    • @codewithnomi
      @codewithnomi  10 หลายเดือนก่อน +1

      I'll check and get back to you 🙂

    • @albinholmgren9045
      @albinholmgren9045 10 หลายเดือนก่อน

      @@codewithnomi Thank you very much!

    • @albinholmgren9045
      @albinholmgren9045 10 หลายเดือนก่อน

      @@codewithnomi thank you very much!

    • @codewithnomi
      @codewithnomi  10 หลายเดือนก่อน +1

      try using this version of tailwind : tailwindcss@3.3.2

    • @albinholmgren9045
      @albinholmgren9045 10 หลายเดือนก่อน +1

      @@codewithnomi i did but still does not seem to fix the problem

  • @abhishekpatil4649
    @abhishekpatil4649 8 หลายเดือนก่อน

    Sir i am not getting tailwind classes suggestions in vs code when i start typing classes. what can i do for that

    • @codewithnomi
      @codewithnomi  8 หลายเดือนก่อน

      you need to install "tailwind intellicence" extension on vs code

    • @abhishekpatil4649
      @abhishekpatil4649 8 หลายเดือนก่อน

      @@codewithnomi sir have it installed already

    • @abhishekpatil4649
      @abhishekpatil4649 8 หลายเดือนก่อน

      @@codewithnomi thank you sir. i got the solution

  • @RonanThomas
    @RonanThomas 4 หลายเดือนก่อน

    Hi Nomi, followed the video, have tailwindcss and nativewind installed but when l write the className css in my homeScreen file, nothing happens, cant change background colour or centre text or anything. Any tips here?

    • @lalithadwarapureddi3283
      @lalithadwarapureddi3283 4 หลายเดือนก่อน

      Yes

    • @codewithnomi
      @codewithnomi  4 หลายเดือนก่อน

      Maybe it's not implemented correctly, did you follow all the steps?

    • @RonanThomas
      @RonanThomas 4 หลายเดือนก่อน

      @@codewithnomi I followed all the steps provided for Nativewind v4 in their documentation, I’m using React Native with Expo Router v2 and Typescript. Not getting any errors but it’s just not doing anything in the simulator.

    • @codewithnomi
      @codewithnomi  4 หลายเดือนก่อน +1

      @@RonanThomas I'm currently working on a series where I'm building a firebase app, I'll explain nativewind 4 setup in that series 😉

  • @Anonymous-pf4cr
    @Anonymous-pf4cr 5 หลายเดือนก่อน +1

    still not working using nativewind any suggestions

    • @codewithnomi
      @codewithnomi  5 หลายเดือนก่อน

      try installing latest nativewind 4, i'll create a tutorial on that soon 😉

  • @mohanj2849
    @mohanj2849 8 หลายเดือนก่อน

    bro how to open , mobile preview on windows like ios ?? plz replay..

    • @codewithnomi
      @codewithnomi  8 หลายเดือนก่อน

      install android studio for android simulator

  • @anikatahsin7716
    @anikatahsin7716 7 หลายเดือนก่อน

    not working nativewind. frustrating to do the react native project using tailwind css.

    • @codewithnomi
      @codewithnomi  7 หลายเดือนก่อน +1

      try using tailwindcss 3.3.2

  • @vuaiduong8918
    @vuaiduong8918 8 หลายเดือนก่อน

    not working with me

  • @user-zq5iy8dr4j
    @user-zq5iy8dr4j 7 หลายเดือนก่อน

    Hi, nice video, how to add google font?

    • @codewithnomi
      @codewithnomi  7 หลายเดือนก่อน +1

      I'll create a tutorial on adding custom fonts 😉

    • @user-zq5iy8dr4j
      @user-zq5iy8dr4j 7 หลายเดือนก่อน

      @@codewithnomi thanks, i wait it very much)

    • @user-zq5iy8dr4j
      @user-zq5iy8dr4j 7 หลายเดือนก่อน

      @@codewithnomi please, custom and google fonts

  • @febrilian
    @febrilian 9 หลายเดือนก่อน

    which one do u prefer?

  • @danieliberi
    @danieliberi 11 หลายเดือนก่อน +1

    nativewind doesn’t work for me and i’ve done everything to make it work

    • @codewithnomi
      @codewithnomi  11 หลายเดือนก่อน

      if you've followed the docs just restart the server and it should work 😉

    • @danieliberi
      @danieliberi 11 หลายเดือนก่อน

      @@codewithnomi is there a way i can send you a message privately and show you how my code is? or could it because of react navigation

    • @codewithnomi
      @codewithnomi  11 หลายเดือนก่อน +1

      sure lets connect on Instagram
      instagram.com/codewithnomi_?igshid=ZDc4ODBmNjlmNQ==

    • @danieliberi
      @danieliberi 11 หลายเดือนก่อน

      @@codewithnomi i’ve sent you a dm bro

    • @rohitbarnwal1420
      @rohitbarnwal1420 11 หลายเดือนก่อน +2

      @@danieliberi any luck??? not working for me as well.... done everything according to the docs....

  • @manojmohapatra986
    @manojmohapatra986 11 หลายเดือนก่อน

    Where are the auto suggestions

    • @codewithnomi
      @codewithnomi  11 หลายเดือนก่อน

      suggestions only show up when we use the className property not inside the style property

    • @manojmohapatra986
      @manojmohapatra986 11 หลายเดือนก่อน +1

      @@codewithnomi he thnx buddy 🫡

  • @harizfauzil7672
    @harizfauzil7672 9 หลายเดือนก่อน

    why don't you make a tutorial from scratch, I'm a little confused about where to start

    • @codewithnomi
      @codewithnomi  9 หลายเดือนก่อน +1

      I literally created this tutorial from scratch 😶

    • @harizfauzil7672
      @harizfauzil7672 9 หลายเดือนก่อน

      @@codewithnomi I mean from the start since installing the dependencies😅

  • @waseemahmed5916
    @waseemahmed5916 10 หลายเดือนก่อน

    i am using typescript when i write className in View Tag it gives me this error can u plz resolve my issue No overload matches this call.
    Overload 1 of 2, '(props: TextProps | Readonly): Text', gave the following error.
    Type '{ children: string; className: string; }' is not assignable to type 'IntrinsicAttributes & IntrinsicClassAttributes & Readonly'.
    Property 'className' does not exist on type 'IntrinsicAttributes & IntrinsicClassAttributes & Readonly'.
    Overload 2 of 2, '(props: TextProps, context: any): Text', gave the following error.
    Type '{ children: string; className: string; }' is not assignable to type 'IntrinsicAttributes & IntrinsicClassAttributes & Readonly'.
    Property 'className' does not exist on type 'IntrinsicAttributes & IntrinsicClassAttributes & Readonly'.

    • @codewithnomi
      @codewithnomi  10 หลายเดือนก่อน

      not sure about this one bro, you have to search online 😉

    • @waseemahmed5916
      @waseemahmed5916 10 หลายเดือนก่อน +1

      @@codewithnomi ok if u find something regarding this do let me know

    • @eraybaydemir8240
      @eraybaydemir8240 5 หลายเดือนก่อน

      did you solve it???

  • @masoom10101
    @masoom10101 11 หลายเดือนก่อน +1

    I need to contact you, how to, email or anything

    • @codewithnomi
      @codewithnomi  11 หลายเดือนก่อน

      send a message on Insta
      instagram.com/codewithnomi_?igshid=ZDc4ODBmNjlmNQ==

  • @emmanuelsheshi961
    @emmanuelsheshi961 5 หลายเดือนก่อน

    thanks alot

    • @codewithnomi
      @codewithnomi  5 หลายเดือนก่อน

      Happy to help