DEV Community

Discussion on: Why do people use JSX?

Collapse
 
vonheikemen profile image
Heiker • Edited

I would say the number 1 reason is flexibility.

You see, when you use a template engine you are at the mercy of that engine. What you can do its limited by the tools that it provides you.

I know that in Vue you can "repeat" an element with the v-for directive, but what if it didn't have it? What would you do?

The JSX folks would argue that they don't need directives, because JSX "It's just javascript." You can use the full power of javascript to hide, show, repeat, transform anything in the UI.

One of the things I don't like about JSX is this:

You can actually make elements that describes a behavior. What bothers me it's not the fact that you can do it, is the fact that it's a common pattern in React apps.

Collapse
 
sleepyfran profile image
Fran González

That deserves a big: thanks, I hate it.