This may be a very stupid question. But I was wondering if I should be using arrow function syntax or the classic function syntax for react components now or is this purely a style choice. I ask this purely as someone trying to work towards industry standards but have found a tremendous amount of mixed comments on it. Also is there any difference using typescript?

Example: const foo = () => {}

Or

function foo() {}

  • Casallas@programming.devOP
    link
    fedilink
    arrow-up
    2
    ·
    1 year ago

    Thank you! I remember reading a bit about this but clearly it didn’t stick! Thank you for the awesome explanation!