Dark Theme React Application [Simplest Way] | Toggle Theme React Tutorial😍

Поделиться
HTML-код
  • Опубликовано: 11 янв 2025

Комментарии • 130

  • @CodeBlessYou
    @CodeBlessYou  Год назад +2

    🤩Access My Complete React Course:- www.udemy.com/course/the-ultimate-react-course-2023-w-real-world-projects/?referralCode=993CD544A6816303D3AD

  • @thosan3090
    @thosan3090 Год назад +15

    Omg i swear when i search for a tutorial on youtube, it'll be more helpful if i hear the Indian accent, thank you so much sir

  • @sohampathak8173
    @sohampathak8173 Год назад +5

    When you can apply things you have learned well but if you can explain it to others in the most simpliest way you are a genius!!! Thanks Genius!!
    👑

    • @CodeBlessYou
      @CodeBlessYou  Год назад

      Thank you so much for your compliment. Grateful for that❤❤

  • @SachinKumar-x9r6k
    @SachinKumar-x9r6k 2 месяца назад

    Most underrated channel in whole coders community ❣❣❣

    • @CodeBlessYou
      @CodeBlessYou  2 месяца назад

      Thank you so much for this comment❤❤❤

  • @thesankharoy
    @thesankharoy Год назад +4

    simple, effective and easy to understand. Thanks a lot

  • @zeeshanali4502
    @zeeshanali4502 Год назад

    i was not expecting this much information but thanks buddy you have done the best work . i really apreaciate your work 💓

    • @CodeBlessYou
      @CodeBlessYou  Год назад

      Thank you so much for your support❤❤

  • @arhampersonal
    @arhampersonal Год назад +1

    Very useful❤❤

  • @carldjovan
    @carldjovan Год назад

    This was very helpful.
    Thank you sooo much :)

  • @ojukwudavid3247
    @ojukwudavid3247 Год назад +1

    This is extremely helpful, thanks a lot man!

    • @CodeBlessYou
      @CodeBlessYou  Год назад

      Thanks for your support. Really grateful for that❤❤

  • @introvert077
    @introvert077 Месяц назад

    working. thanks

  • @dipankarbarman5307
    @dipankarbarman5307 Год назад

    Nice logic very helpful ❤

  • @publicshortsviral
    @publicshortsviral Год назад

    Keep uploading bro 👍

  • @Karp22_
    @Karp22_ Год назад

    Thanks a lot! New suscriber

  • @surajbera865
    @surajbera865 Год назад

    Nice video, also filled up the form.

  • @МаксимСоловьев-с9н

    This is so simple, thank You!!!

  • @ruthra5398
    @ruthra5398 Год назад

    Nice one....easy one

  • @gladiatorx77
    @gladiatorx77 Год назад

    Really helpful man. Thanks a lot!

    • @CodeBlessYou
      @CodeBlessYou  Год назад

      Thank you for your support brother😇❤❤

  • @MrBumbo90
    @MrBumbo90 Год назад

    Great video and to the point. Thanks a lot!

  • @uminhtetoo
    @uminhtetoo Год назад

    Thank you so much for sharing your knowledge, Sir.

  • @hottvomit
    @hottvomit Год назад

    Great video, thanks

  • @wesalahmed-pl3mj
    @wesalahmed-pl3mj Год назад

    thank you soo much you helped me a lot!!

  • @ewweeewewweweewwe
    @ewweeewewweweewwe Год назад

    Thank you!

  • @LuisRodriguez-ro5py
    @LuisRodriguez-ro5py Год назад

    A lot of value in this short video

  • @sakibulhasan6345
    @sakibulhasan6345 8 месяцев назад

    this is gold

  • @kimhwanhoon
    @kimhwanhoon Год назад

    thank you man!

  • @paf_developpement
    @paf_developpement Год назад

    ❤🎉 Thank You

  • @YounusFoysal
    @YounusFoysal 8 месяцев назад

    Thank you

  • @mhhamzaedits
    @mhhamzaedits 8 месяцев назад

    Mashallah 😍😍

  • @All365_Khaladunnabi
    @All365_Khaladunnabi 8 месяцев назад

    Thanks

  • @romimaximus
    @romimaximus Год назад

    At 4:25mins ... i have no idea where u got the "[data-theme="dark]" from ?.. and whats "[data-theme]" ?

    • @CodeBlessYou
      @CodeBlessYou  Год назад

      [data-theme="dark"] is we add attribute to the body element in our setDarkMode function[at 1:30]:
      document.querySelector("body").setAttribute('data-theme', 'dark');
      [data-theme] is an attribute to know the data of current application theme. If our data-theme="dark", then currently user select dark mode, else user in light mode.❤

  • @peterwong246
    @peterwong246 3 месяца назад

    can you tell us why we need to use ReactComponent for import svg, but we cannot do that with the png or jpg??
    Thanks a lot!!!

    • @CodeBlessYou
      @CodeBlessYou  3 месяца назад +1

      See SVGs can be treated like components because they're XML-based, while PNGs and JPGs are static image files that can't be dynamically manipulated in the same way.

  • @muhammadrifqy24
    @muhammadrifqy24 Год назад

    TYSM!

  • @acm1ptmiamor
    @acm1ptmiamor Год назад

    excelent!

  • @bijoy3369
    @bijoy3369 Год назад

    Can we add 3rd and 4th theme also? Like daisyUI?

    • @CodeBlessYou
      @CodeBlessYou  Год назад

      Yes you can. But keep in mind, more choice more users gets confused.

  • @waqasalam_007
    @waqasalam_007 4 месяца назад +1

    Why you are using dom in react?

  • @hamidmammadli6360
    @hamidmammadli6360 Год назад

    go on my brother

    • @CodeBlessYou
      @CodeBlessYou  Год назад

      Thanks for your support brother😇❤

  • @asha8201
    @asha8201 Год назад

    After adding that folder, what are all the changes we need to make in the react folder to make it work?

    • @CodeBlessYou
      @CodeBlessYou  Год назад

      After adding folder, You just need to add DarkMode component in your Component in which you want to display.
      After that you can also modify CSS according to your needs

    • @CodeBlessYou
      @CodeBlessYou  Год назад

      Sorry Asha, I recently check this DarkMode zip and I uploaded end file at the place of beginner file. You can now download the starter file, that will not give you any error. Sorry for that again

  • @suryapasupuleti60
    @suryapasupuleti60 4 месяца назад

    how to fix the delay on text changing colors?

    • @CodeBlessYou
      @CodeBlessYou  4 месяца назад

      remove transition CSS from the style

  • @anupamrevanth5911
    @anupamrevanth5911 10 дней назад

    Hi sir,actually i am following the course on udemy . I am getting error in the same section while adding darkmode component even after trying same said on tutorial facing same issue unable to resolve can you help ???

    • @CodeBlessYou
      @CodeBlessYou  9 дней назад

      Yes. Show me the error in the QnA Section of that lesson in which you are getting error. I will try to solve that error

    • @anupamrevanth5911
      @anupamrevanth5911 9 дней назад

      @CodeBlessYou sure sir i will

  • @erencetin7805
    @erencetin7805 5 месяцев назад

    I did everything what you have done , toggle button appears on the screen but colors don't change.What should I do?

    • @CodeBlessYou
      @CodeBlessYou  5 месяцев назад

      Try to inspect CSS, maybe there are some changes

    • @erencetin7805
      @erencetin7805 5 месяцев назад

      ​@@CodeBlessYouI solved it , thanks

    • @CodeBlessYou
      @CodeBlessYou  5 месяцев назад

      @@erencetin7805 ❤❤❤

  • @Saivivek-l4c
    @Saivivek-l4c 11 месяцев назад

    Hi brother do you have monalisa ttf file as you used in the project can you send it I can use it

    • @CodeBlessYou
      @CodeBlessYou  11 месяцев назад

      It's illegal to share purchased fonts. But you search for that, then you can get that font FREE.

  • @nathanielgonzalez9598
    @nathanielgonzalez9598 11 месяцев назад

    I am attempting to use localStorage in a Nextjs environment, but I am getting a "localStorage not defined error". I did some reading and learned it should not work in a Reactjs environment either, yet you are able to. Why is this? Am I missing something? Any help would be greatly appreciated. Thank you so much for your video.

    • @CodeBlessYou
      @CodeBlessYou  11 месяцев назад

      If you are encountering a "localStorage not defined" error, consider the following:
      Make sure you are using localStorage in the client-side code, not in server-side rendering (SSR) or during the build process.
      Check if there are any conditional statements or environments that might prevent the code from running on the client side.
      Confirm that your code is running in the browser environment.

    • @nathanielgonzalez9598
      @nathanielgonzalez9598 11 месяцев назад

      @@CodeBlessYou Thank you so much! I have much to learn regarding the client vs server side rendering, but I greatly appreciate that you've pointed me in the right direction.

    • @nathanielgonzalez9598
      @nathanielgonzalez9598 11 месяцев назад

      @@CodeBlessYou It worked!! You are the best. Thank you, my friend. Just subscribed to your channel!

    • @CodeBlessYou
      @CodeBlessYou  11 месяцев назад

      My pleasure @@nathanielgonzalez9598

    • @CodeBlessYou
      @CodeBlessYou  11 месяцев назад

      Grateful for that brother@@nathanielgonzalez9598

  • @harshafly
    @harshafly Год назад

    thank you

  • @philipokorie5556
    @philipokorie5556 Год назад

    I can see that my toggle works but the colours don't change

    • @CodeBlessYou
      @CodeBlessYou  Год назад

      Try to inspect and check dark attribute is adding or not

  • @danielparinding1108
    @danielparinding1108 10 месяцев назад

    i have follow the steps,but i got an error:
    Uncaught SyntaxError: import not found: ReactComponent
    can you give solution?

    • @CodeBlessYou
      @CodeBlessYou  10 месяцев назад

      We get this error because of React Update.
      First you have to install one package, npm install vite-plugin-svgr@3.2.0
      and in your vite.config.js file, you have to add svgr plugin in plugin array.
      Use this github repository - github.com/pd4d10/vite-plugin-svgr#readme

  • @SuperMBARutgers2013
    @SuperMBARutgers2013 Год назад

    I'm getting an error: Warning: Invalid DOM property `for`. Did you mean `htmlFor`?

    • @CodeBlessYou
      @CodeBlessYou  Год назад

      In react, we can't use for attribute because it is reserved keyword in JavaScript (for loop). Same as class and className. So we have to use htmlFor instead of for in label

  • @RajeshKumar-xx8ey
    @RajeshKumar-xx8ey Год назад

    Hi Bro,
    kindly make a video in React Js bro
    Your Videos make easy to learn react
    ASAP make video in react
    thanks a lot

    • @CodeBlessYou
      @CodeBlessYou  Год назад

      Currently Working on Complete React JS course which will cover all important concepts with real world projects. You can register for FREE from here: forms.gle/aBtV1aRdcbztDwF3A

  • @mehrdadsadeghizadeh3219
    @mehrdadsadeghizadeh3219 4 месяца назад

    tanks

  • @jeff_yss
    @jeff_yss Год назад

    Good logic

  • @shubhamjangid5936
    @shubhamjangid5936 11 месяцев назад

    how can i do this same thing in scss and react

    • @CodeBlessYou
      @CodeBlessYou  11 месяцев назад

      Once you understand the logic of Dark Theme then you can apply it on any thing

  • @ishansaxena827
    @ishansaxena827 Год назад

    How to toggle data-bs-theme="dark" to data-bs-theme="light" in new Bootstrap 5.3
    My Content

  • @rasulgold5466
    @rasulgold5466 Год назад

    Why my css code don't working?

    • @CodeBlessYou
      @CodeBlessYou  Год назад

      Check you imported CSS file at the top or not

  • @brandonbh04
    @brandonbh04 Год назад

    When you set the dark theme attribute on the body, aren’t we not supposed to directly change DOM elements when working with React?

    • @CodeBlessYou
      @CodeBlessYou  Год назад

      You can use this or you can define state variable and change that state variable on toggle and toggle className for our app component div. You can do it both ways

  • @ivan4486
    @ivan4486 Год назад

    Using querySelector in a react app doesn't look good to me. There should be a better way of doing that.

    • @CodeBlessYou
      @CodeBlessYou  Год назад +1

      I will upload the update version on this Video :)

  • @adarsh-chakraborty
    @adarsh-chakraborty Год назад

    Vs code font & theme?

  • @saim4556
    @saim4556 8 месяцев назад

    where is source code......

  • @okkillerkd
    @okkillerkd 11 месяцев назад

    can you provide whole code plzzzz

    • @CodeBlessYou
      @CodeBlessYou  11 месяцев назад +1

      I don't have the source code now. Because I think I record this video one year ago. Still I will check my backup. If it is available then I will inform you❤❤

    • @okkillerkd
      @okkillerkd 11 месяцев назад +1

      @@CodeBlessYou ok thanks

  • @babar178
    @babar178 5 месяцев назад

    Hello sir i m very poor and unable to pay for your react paid course can you please provide me for free your react course .plz plz sirr😢

    • @CodeBlessYou
      @CodeBlessYou  5 месяцев назад +1

      Contact me on Instagram, When I create coupon for React Course I will give you FREE❤❤❤

    • @babar178
      @babar178 5 месяцев назад

      @@CodeBlessYou thank you so much sir

    • @CodeBlessYou
      @CodeBlessYou  5 месяцев назад +1

      @@babar178 Here is the FREE Access - www.udemy.com/course/the-ultimate-react-course-2023-w-real-world-projects/?couponCode=FF4E7D5CD87487F51D26

  • @vaswna14
    @vaswna14 Год назад

    Nice solution but you don’t use react with states or context and your way is a bit difficult to unterstand

    • @CodeBlessYou
      @CodeBlessYou  Год назад

      Yes It is Vanilla JavaScript and React also build on Vanilla JavaScript. Thanks for your support. Really grateful for that😀❤❤