DEV Community

Dillon
Dillon

Posted on

REACTing to React

  1. Import dependencies. There are two of them.

import React from 'react'; -- this is the core react library.
import {createRoot} from 'react-dom/client'' (react-dom for web, react-native for mobile or desktop apps, and one more.

React doesn't have divs, it has text, view, and pressable.

  1. Create a react element

React.createElement -- this is a funciton that accepts three or more arguments.

  1. Render the application

const container = document.querySelector('#root');
const root = createRoot(container);
root.render(element);

in html version of the file, you have the following element

Top comments (0)