Rendering a List of Components in React

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

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

  • @Pareshbpatel
    @Pareshbpatel Год назад +3

    So many key React concepts explained along the way. Thanks, Sam
    PS You have a great teaching style.
    {2023-06-07}

  • @avertry9529
    @avertry9529 2 года назад +6

    Last week I found out why we shouldn't use the index as key.
    for example if index 0 is deleted, all the keys change their value as the index shifts(1 becomes 0, 2 becomes 1, etc.)
    Then ALL are re-rendered instead of just the updated or deleted one.
    The reason your code works without a key, is React will use the index itself, with a warning. I find it really useful to know why things work or don't work, and it helps in memorisation.

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

      May I know where you find this?

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

      @@shinobi1975 Cannot remember sorry.

  • @HarisSohail-zo5mh
    @HarisSohail-zo5mh 5 месяцев назад +1

    You taught this concept in 8 mins that my teacher couldn't do in 90 mins. Cheers

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

    good video. i understand that there should be uniqueness to the elements in the json array, but it's not very clear to me why there isn't an error when you create the joke component dynamically, as it looks like it only accepts joke and rating as arguments. i'm guessing it's something in vanilla javascript with how a function accepts arguments, but it's not very intuitive.

  • @AravinthK-q9k
    @AravinthK-q9k Год назад

    what if i am render a table instead of the joke component for me its getting page unresponsive if i render 30 tables inside that different rows and columns

  • @Cooper_246
    @Cooper_246 6 месяцев назад

    How did you make the like button glow like that, when you said to press it? Never seen that before, cool.

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

    Great videos mate learning alot from you!

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

    Great Tutorial,so happy I found your channel

  • @fromagetriste
    @fromagetriste 9 месяцев назад

    great video

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

    Very nice thanks Sam

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

    You deserve more fame

  • @siavoshoon
    @siavoshoon 2 года назад

    Greate job, same as always👍

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

    Thanks!