React onClick: Direct Call vs Arrow Function - What's the Difference?

Поділитися
Вставка
  • Опубліковано 22 січ 2025

КОМЕНТАРІ • 10

  • @doremon81072
    @doremon81072 20 днів тому +6

    Lovely explanation thanks

  • @TheAbhidugar
    @TheAbhidugar 19 днів тому +8

    I think this is not just in react but a basic programming concept which works for most languages. Btw Flutter dev here.

    • @altercodes1
      @altercodes1  18 днів тому +1

      You're absolutely right! The concept is indeed a fundamental programming principle that applies across many languages, including Flutter. I highlighted it in the context of React, but the core idea remains the same. Thanks for pointing that out, and it's great to hear from a Flutter dev!

  • @mohomedrushdi6170
    @mohomedrushdi6170 15 днів тому

    well said

  • @cecilselormamediku9560
    @cecilselormamediku9560 15 днів тому

    Excellent brother, thanks❤🎉

  • @thedavistheory7674
    @thedavistheory7674 15 днів тому

    You should also have explained that calling the function without parentheses works if the function we're passing has the same signature as the one defined as prop

  • @jaseembinmuhammed5861
    @jaseembinmuhammed5861 17 днів тому +4

    What’s in your thumbnail is completely different from what you have explained
    😢

    • @8ack2Lobby
      @8ack2Lobby 14 днів тому

      yes, but there is no diff between the processing of {myFunction} and {() => myFunction()} except an additional function call in the second one.

  • @kristenstewart9458
    @kristenstewart9458 17 днів тому

    Nice 👍