0

What is the difference between these two functions? They both seem to produce the same output.

Pros and cons? Or are they exactly the same?

const Footer = () => {
    return (
        <Footer>This is the footer</Footer>
    )
}

and

function Footer() {
    return (
        <Footer>This is the footer</Footer>
    )
}
Sondre
  • 1
  • 1

1 Answers1

0

The second one will:

  • be hoisted
  • create it's own context

First one won't do either.

T J
  • 42,762
  • 13
  • 83
  • 138