DEV Community

Discussion on: What's a React Component?

Collapse
 
chantastic profile image
chantastic

Hi Jen!

Yes. Most React developers never interact with React.createElement directly. But it is a function that every React developer uses indirectly.

JSX is a syntax extension that works in the compilation phase — likely Babel.

It just looks for angle brackets and turns them to React.createElement calls before they get to the browser.

This is the reason that every module with a component needs to import React from "react", even if your code does not directly refer to that import.

Here are more details on the Babel plugin that powers this in most React apps: babeljs.io/docs/en/babel-plugin-tr...

I hope this was helpful happy to dive in more.

Michael