DEV Community

Discussion on: This is why you can't return adjacent JSX elements.

Collapse
 
thehanimo profile image
Hani • Edited

What if React could automatically add <>, </> around these adjacent JSX elements?

Collapse
 
tusharkashyap63 profile image
Tushar Kashyap • Edited

But your program will never reach that stage when React can do anything. Wrong syntax will break your program in the first place. Please abide by the rules of JavaScript as React is just JavaScript.

Collapse
 
thehanimo profile image
Hani

I mean, while compiling, can’t React intelligently figure it out and add a parent block? I know it doesn’t do that now but it is quite possible isn’t it?

Thread Thread
 
Sloan, the sloth mascot
Comment deleted
 
devhammed profile image
Hammed Oyedele

That is asking too much 😅

React is just a library.