The first react Hello.js makes no sense why are you storing the jsx in the variable element and not returning it directly also the export can be directly on the function if you would have done that you would see how clean it becomes. Also it is true that svelte is faster on normal apps and site but let's say you are rebuilding excel in the web with thousands of rows then the vdom will update faster.
It is an example of JSX, and you are free to store a component to variables. This example is not to show the cleanest of them, but to show the basic syntax.
Why wouldn't a react developer export it separately? Almost every example I've seen does it that way. And the three companies that I've professionally worked on react code at have done it this way. I find it easier so that you can wrap the export with things like redux or apollo. What an odd thing to say!
I find the code example weird because the svelte code includes css, while the react code does not. Also in the svelte code you explicitly set the var "name" to "world", but then in the react code you pass in a prop named "world"... that's really confusing.
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
The first react Hello.js makes no sense why are you storing the jsx in the variable element and not returning it directly also the export can be directly on the function if you would have done that you would see how clean it becomes. Also it is true that svelte is faster on normal apps and site but let's say you are rebuilding excel in the web with thousands of rows then the vdom will update faster.
It is an example of JSX, and you are free to store a component to variables. This example is not to show the cleanest of them, but to show the basic syntax.
This is not how a React Developer would write it, it should be written how everyone would and not as ugly as possible.
Special for you: 🙂
Why wouldn't a react developer export it separately? Almost every example I've seen does it that way. And the three companies that I've professionally worked on react code at have done it this way. I find it easier so that you can wrap the export with things like redux or apollo. What an odd thing to say!
I find the code example weird because the svelte code includes css, while the react code does not. Also in the svelte code you explicitly set the var "name" to "world", but then in the react code you pass in a prop named "world"... that's really confusing.