DEV Community

Discussion on: Anyone else intolerant of html inside javascript? yes i mean React

Collapse
 
afcjunior profile image
Adalberto Camacho Jr.

Nothing's stopping you from writing react components using React.createElement everywhere. Everything will work the same. You won't have "HTML in your JS", so you'll be happy.

Your only trade-offs would be a less maintainable codebase and longer developing time.

I really don't understand the argument against using JSX...

Collapse
 
vonheikemen profile image
Heiker

Assigning React.createElement to a variable with a short name is also a valid approach:

const h = React.createElement;