3

Consider the below function

function DummyComponent() {
   return (
      <div class='dummy'>
       <p> Hello world </p>
      </ div>
   )
}

Now DummyComponent can be used in two ways to render

Method 1:

<DummyComponent />

Method 2

<>
  {DummyComponent()}
</>

What is the difference between the two considering both get the job done? Are there any advantages or disadvantages for either of the two methods?

2

1 Answer 1

1

Method 2 is much fast, for further details, please go through link below.

https://medium.com/missive-app/45-faster-react-functional-components-now-3509a668e69f

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.