...

/

Alternatives to the react.createElement() Method

Alternatives to the react.createElement() Method

Learn about the alternatives to the react.createElement() method: JSX syntax and the htm library.

Repeated usage of react.createElement() might compromise the readability of our React components. In fact, nesting many invocations of the react.createElement() method, even with our h() alias, will make it hard to understand the HTML structure we want our components to render.

For this reason, it’s not very common to use react.createElement() directly. To address this problem, the React team offers and encourages an alternative syntax called JSX.

Using JSX

JSX is a superset of JavaScript that ...