DEV Community

Discussion on: Why I Converted from Vue to React

Collapse
 
unwrittenfun profile image
James Birtles

You seem to think that you are calling some magical return function. You're not. You are simply returning the JSX, the brackets there are not a function call, they're there for formatting the JSX over multiple lines as a return can't have a newline after it.

Collapse
 
sroehrl profile image
neoan • Edited

Yes, good point. At first I didn't know what you meant, but reading my comment again, I see what you mean. I make it sound like there is a function named "return". While there is no function "return" in the React framework, you are effectively passing it on to the render function. I should have been more specific/less ambiguous. My point was that declaration shouldn't be confused with how things work. I felt like many of the arguments were comparable with saying "webpack is just a json".

Edit: and reading my comment once more, you actually can't read it any other way than you have. I will have to change that.