react-elements Flashcards
1
Q
What is React?
A
A Javascript library for building user interfaces
2
Q
What is a React element?
A
Object that describes a DOM node and its attributes or properties you can say. It is an immutable description object and you can not apply any methods on it. React Component - It is a function or class that accepts an input and returns a React element
3
Q
How do you mount a React element to the DOM?
A
- query select the element that exists in html
- use the createRoot() method of the ReactDOM object and the variable for the querySelector as an argument, assign to a variable
- render method of the variable of the root created in step 2, and take the element created by React.createElement