DEV Community


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

thehanimo profile image
Hani • Edited

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

tusharkashyap63 profile image
Tushar Kashyap Author • 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.

thehanimo profile image

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.

Forem Open with the Forem app