WATCH NEXT: React Interview Questions and Answers - Dominate Your Next Interview - kzbin.info/www/bejne/r4Kro2elpd-ShJIsi=51b2XP_84GH3q6oF
@prateek42799 ай бұрын
would have taken me a whole lot of time doing it by myself :( so thanks for your help !!keep up the good work:)
@MonsterlessonsAcademy9 ай бұрын
Glad I could help!
@walassi834 Жыл бұрын
how could you show us this much content in 14 minutes. this was incredible!
@MonsterlessonsAcademy Жыл бұрын
Magic!
@EleceG7 ай бұрын
Really nice and clear code, Thank you for sharing this :)
@MonsterlessonsAcademy7 ай бұрын
You're welcome!
@computerscience11523 жыл бұрын
Interesting tuturiol, Awesome... Subscribed
@MonsterlessonsAcademy3 жыл бұрын
Thanks for the sub!
@unknownrus9203 жыл бұрын
Interesting approach, but 1 question, isnt it easier to have in index css on body a set of color variables and just rewrite them with darktheme class and its color values. darktheme class is added on the body via some kind of a toggler
@MonsterlessonsAcademy3 жыл бұрын
The main problem with your approach is that css and color variable are not usable inside js. Which means we can't write logic, conditions, etc with them. Here are can do that because it's in js.Theme is not only colors, it can be margins, paddings, sizes, booleans, etc. P.S. But if you just have several global variables your approach may be easier.
@dhavaljprasad11 ай бұрын
I understood the video, but what if i don't want to use style attribute for my tags, instead I want it to use in custom styled component file. How we can do that ? Please, I'm stuck on this, and I really want to get this done. Any suggestions or help ?
@MonsterlessonsAcademy11 ай бұрын
You can store just theme name and render different components depending on the them. Or provide different props to styled comp.
@samarosman711010 ай бұрын
The video was amazing man!🎉 Thank a lot. Could you make a video to show how to create multi language app using React Context, please?
@MonsterlessonsAcademy10 ай бұрын
I will add your idea in the list of future videos
@sd-kg8tq2 жыл бұрын
Thanks for the video. Really helped me with my react project.
@MonsterlessonsAcademy2 жыл бұрын
Great to hear!
@alexanderborisov18282 жыл бұрын
Great usage of context. It is a nice video to start with and expand further according to your needs. By the way, it is better to use "useLayoutEffect hook" instead of "useEffect hook". Because your current implementation causes CSS flickering while the page is being reloaded.
@MonsterlessonsAcademy2 жыл бұрын
Yes, you are totally right!
@sd-kg8tq2 жыл бұрын
Thanks for that. Saved me time to start looking for a solution. Works great.
@tanushridas8264 Жыл бұрын
Thanks brother
@MonsterlessonsAcademy Жыл бұрын
You are welcome!
@YaroslavEx Жыл бұрын
дякую!
@denver3583 Жыл бұрын
how we can add multiple style on one theme mode? I am trying but it is not working at all, Please help :(
@mehdijafarzade23815 ай бұрын
awesome bro
@MonsterlessonsAcademy5 ай бұрын
thanks
@pro-cr2eo3 жыл бұрын
amazing! Thanks for the video.
@MonsterlessonsAcademy3 жыл бұрын
Glad you liked it!
@jixster1566 Жыл бұрын
How do you do this for more than 2 themes
@MonsterlessonsAcademy Жыл бұрын
Store not boolean but a string with theme name.
@katarina4tiaotiao3 жыл бұрын
I didn't know react could do this!
@MonsterlessonsAcademy3 жыл бұрын
Something new every day :)
@gigakvachakhia47773 жыл бұрын
interesting video as always.
@MonsterlessonsAcademy3 жыл бұрын
Glad you enjoyed it
@workmoneyworkmoney Жыл бұрын
This is more complicated than vanilla javascript XD
@MonsterlessonsAcademy Жыл бұрын
Sure but it is difficult to build big production apps with vanilla
@eduardstransky77222 жыл бұрын
This tutorial is very basic. It can be applied on 1% of basic sites. Try toggle an app between 2 bootstrap themes light and dark, and you will see what i am saying. There will be the flicker on switch. And other problems. You will need a script tag before react initialize to block react and get the browser selected theme and from there the things get complicated if you have autentification... get user preferences from db .. light,dark, or no selection ... from there to put in localstorage.. and so on. This tutorial is 1% of what must be done.
@MonsterlessonsAcademy2 жыл бұрын
Well, yes. it was never intended to be a fully featured production solution with all possible cases :)