Build a React Accordion from Scratch | ReactJS tutorial

Поділитися
Вставка
  • Опубліковано 25 сер 2024
  • Learn how to build an accordion in ReactJS. We'll go through and demonstrate piece by piece how to put together an accordion.
    💛 Be sure to comment like and subscribe to the channel! I have plenty more videos: / @thetechteam

КОМЕНТАРІ • 93

  • @growthrough2123
    @growthrough2123 2 роки тому +8

    at minute 7:42 there are some styles added that the presenter doesn't talk about! Unless I missed it... He adds some styles to .content and then adds .content.show

    • @shaksham.22
      @shaksham.22 5 місяців тому

      i was wondering about the ame

  • @aarongarcia2433
    @aarongarcia2433 2 роки тому +2

    Thank you so much! Of all the tutorials, articles, and codepens I searched through, this is the only one that worked in my case.

  • @kelsola
    @kelsola 2 роки тому

    Prior to this video, I used an NPM package for my Accordion, but I caught a bug that couldn't be fixed and made no sense (over 5 hours wasted), so I knew I needed to build one from scratch. After watching your video, probably 45 minutes later, my "from scratch" Accordion is working perfectly. So thank you very much.

    • @a.human.
      @a.human. 2 роки тому +1

      I feel you. I wasted my entire day today trying to fix a bug related to react slick. I finally got rid of it and built a carousel myself. Still, so much left to do today... I'm tired.

    • @kelsola
      @kelsola 2 роки тому +1

      @@a.human. Yeah, working with packages can be a real pain in the butt when trying to fix undesired behaviors. I know that all too well from working with Rich Text Editors...

  • @gabrielobafisile2299
    @gabrielobafisile2299 Рік тому +1

    I love the way you simplified this. Thanks bro

  • @shaksham.22
    @shaksham.22 5 місяців тому +1

    If anyone doesnt understand why the stuffs get hidden at 7:34 then its because he adds another class content.show to it (see at 13:42) where content class hides the answers and content.show reveals it

  • @shalombloodman1009
    @shalombloodman1009 2 роки тому +3

    the reason one would find trouble with the code is because it was made directly in the app.js file, you have to destructure it yourself and he said so in the video.

  • @pesahson
    @pesahson 3 роки тому +8

    Looks really good. That transition makes it work super cool.

    • @prathmeshkalehere
      @prathmeshkalehere Рік тому

      I did it all step by step but I can't seem to get transition effect on it

    • @artanme
      @artanme Рік тому

      @@prathmeshkalehere same, i even tried using chatgpt to help me, but it doesn't work

  • @autumn4421
    @autumn4421 9 місяців тому

    Simple, cool, effective and that's only the way which i could use
    Thank you so much!

  • @whysoserious-yj1ku
    @whysoserious-yj1ku 2 роки тому

    Thank you! Dont know about the other comments.. i am working in Functional Components and this works like a charm

  • @mazhabshosolihov1122
    @mazhabshosolihov1122 Рік тому +1

    Thanks bro

  • @RizaHariati
    @RizaHariati 3 роки тому +1

    Very simple to the point explanation. Thank you

  • @JenniferThomas-wz2qu
    @JenniferThomas-wz2qu 2 місяці тому

    Very cool, thanks

  • @user-ks9zc3bi2p
    @user-ks9zc3bi2p 4 місяці тому

    perfect thank you bro

  • @RizaGunturPrakoso
    @RizaGunturPrakoso 2 роки тому +6

    after you set flex and center suddenly answer hidden, why is that?

    • @XxSouIxX
      @XxSouIxX 2 роки тому +6

      He added "max-height: 0" and "overflow: hidden" to the 'content' class off-screen, apparently.

    • @limitlessmedow4682
      @limitlessmedow4682 Рік тому

      @@XxSouIxX wow thanks I was asking myself that same question

    • @codenamemoe9337
      @codenamemoe9337 Рік тому

      @@XxSouIxX Thank you, I was thinking the same thing.

    • @manitripathi9463
      @manitripathi9463 Рік тому

      ua-cam.com/video/XtkIFwQkacQ/v-deo.html

  • @dorocodes7280
    @dorocodes7280 Рік тому +1

    would be awesome to publish the code and add a link to it in the video description

  • @mahidharreddy8371
    @mahidharreddy8371 2 роки тому

    Thank You bro. .. You just saved my Day..

  • @InteligenciaEficiente
    @InteligenciaEficiente 2 роки тому

    Great! will use this logic on my project, thank you!!

  • @missionmaths3867
    @missionmaths3867 Рік тому

    Thankyou you are a great teacher

  • @shadowrebels1623
    @shadowrebels1623 Місяць тому

    thank you !!!!

  • @ydub18
    @ydub18 2 роки тому

    Perfect explanation. Thank you!

  • @youhavetodoit9070
    @youhavetodoit9070 Рік тому +1

    Thank You So Much

  • @vladko9623
    @vladko9623 2 роки тому

    Thank you so much. You have helped me! )

  • @michellephoebe
    @michellephoebe 2 роки тому

    I have been having issues with React accordions cause the packages make the documentation bigger.
    This is the best! Thank you!
    Do you have a tutorial on nested accordion?

  • @todortodorov9240
    @todortodorov9240 Рік тому

    Simple and effective. Thank you.

  • @DuckYou25
    @DuckYou25 2 роки тому +1

    code works thanks, i dont what these dudes are saying

  • @visheshkumar8015
    @visheshkumar8015 Рік тому

    kept simple and well explained

  • @CKNMEDIA
    @CKNMEDIA 2 роки тому

    Excellent stuff. Its working. 🔥🔥

  • @prathmeshkalehere
    @prathmeshkalehere Рік тому +1

    I did it all step by step but I can't seem to get transition effect on it

  • @joecolas
    @joecolas 2 роки тому

    Thank you so much . this is very helpful

  • @rasulakhundov500
    @rasulakhundov500 2 роки тому

    Thank you so much. So good tutorial

  • @joepilibi
    @joepilibi Рік тому

    Simple and efficient, nice !

  • @yehch989
    @yehch989 4 місяці тому

    Thank you so much!

  • @maxaquilino7264
    @maxaquilino7264 2 роки тому

    Excellent stuff, well done!

  • @Netik-AbonneToi59
    @Netik-AbonneToi59 8 місяців тому

    Thank you bro !

  • @velloss
    @velloss 3 роки тому +1

    helped me a lot, thankssssssss

  • @kangegha
    @kangegha 2 роки тому +2

    what is the 'i' in the toggle function? 'index'? I got error saying that 'i' is indefined...

    • @kalahari8295
      @kalahari8295 2 роки тому +2

      I is referring to a specific item index

  • @Bhartiya_ekta
    @Bhartiya_ekta 7 місяців тому

    Thanks a lot 🎉

  • @NguyenDat-ee8kv
    @NguyenDat-ee8kv Рік тому

    Thank u bro i made it

  • @LeGabrieell
    @LeGabrieell Рік тому

    Thank you so much!!

  • @BreatheWithoutHS
    @BreatheWithoutHS Рік тому

    Thank you, Sir!

  • @andreporto7451
    @andreporto7451 Рік тому

    very good, man!

  • @dailyshorts723
    @dailyshorts723 2 роки тому

    great work bro

  • @alexeysedov278
    @alexeysedov278 Рік тому

    thank you!

  • @Dwedari
    @Dwedari 2 роки тому

    Really appreciate it

  • @kishorkumarsoni
    @kishorkumarsoni 3 роки тому +1

    Thanks sir. Awasome..👌

  • @MrBuloy11
    @MrBuloy11 Рік тому

    it is good but needs to fix the shaking part, every time it is toggle.

  • @ainneo
    @ainneo 2 роки тому

    amazing!!!!! thank you!

  • @harshithakapa8019
    @harshithakapa8019 2 роки тому +1

    @the tech team can u plz share the code?

  • @MariaFerraro
    @MariaFerraro Рік тому

    Thank you!!!!

  • @abdullahjaved2044
    @abdullahjaved2044 Рік тому

    Thanks Alot❤❤

  • @twistekk7
    @twistekk7 Рік тому

    where to get this lorem ipsum text?

  • @kirillpavlovskii8342
    @kirillpavlovskii8342 3 роки тому

    Great, thanks

  • @ViKiNG_89
    @ViKiNG_89 2 роки тому

    Thanks )

  • @sagarmisra6932
    @sagarmisra6932 3 роки тому

    Not working with class component, any reference??

  • @absoluteagency4306
    @absoluteagency4306 3 роки тому +1

    Awesome and simple , thanks

  • @sunitajoshi-we7cn
    @sunitajoshi-we7cn Рік тому

    Where i can get the code

  • @Scream-ne3np
    @Scream-ne3np 2 роки тому

    good job

  • @brandon400
    @brandon400 2 роки тому

    it helps me. thx
    how can i unselect an item?

    • @Paulluskelvin
      @Paulluskelvin Рік тому

      Add the else keyword just after your if statement.
      As in else setSelected(i);

  • @Naz-h8z
    @Naz-h8z Рік тому

    source code? sound quality?

  • @ImperioTeixeira
    @ImperioTeixeira Рік тому

    hi, very good video, I have a question though, can we use bootstrap accordion in react and to do the same thing you did?

  • @mohammadmahdialvansaz8001
    @mohammadmahdialvansaz8001 Рік тому

    thanks

  • @kalahari8295
    @kalahari8295 2 роки тому

    Best 🔥

  • @blesintotv1803
    @blesintotv1803 4 місяці тому

    i is not defined

  • @thokozanichisembele8877
    @thokozanichisembele8877 Рік тому

    shout you out brudda

  • @usamabintahir8284
    @usamabintahir8284 3 роки тому +2

    code available?

  • @netsaosa4973
    @netsaosa4973 Рік тому

    epic

  • @user-ml4ux7lp1s
    @user-ml4ux7lp1s Рік тому

    i have not worked

  • @temirov6411
    @temirov6411 2 роки тому +1

    'i' is not defined no-undef

    • @MrLefteris3000
      @MrLefteris3000 Рік тому +2

      too late propably but did you manage to find what was wrong?

    • @Paulluskelvin
      @Paulluskelvin Рік тому

      Your map should receive at least two arguments. You probably didn't define it there.

  • @theroastingershow161
    @theroastingershow161 3 роки тому +1

    not working properly

  • @Codingkite
    @Codingkite 3 роки тому

    no working

  • @marvellousadesanya8480
    @marvellousadesanya8480 Рік тому

    volume extremely low.

  • @orangelimesky
    @orangelimesky 2 місяці тому

    Garbage. He doesn't explain anything about the css involved

  • @Codingkite
    @Codingkite 3 роки тому

    time visit my two hour😡 not working class

  • @Codingkite
    @Codingkite 3 роки тому +1

    fake video

  • @viog8421
    @viog8421 10 місяців тому

    Gracias, fue muy útil

  • @temirov6411
    @temirov6411 2 роки тому

    time visit my two hour😡 not working class