Reputation: 458
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?
Upvotes: 3
Views: 704
Reputation: 93
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
Upvotes: 1