I have basic knowledge of JavaScript. Currently, working in a ReactJS project in which developers have assigned ReactJS component to a variable as following:
formComponent = (
<Component1
propOne={...}
/>
)
Is it the right way to do? How expensive it is?
Just like @borisyankov said, it's just a reference assignment. You shouldn't really worry about it. :)
Boris Yankov
Front-End Engineer
It is extremely fast. This is just a reference assignment. As an example, even on a phone, this operation can be performed many millions of times in a second.