react-elements Flashcards
1
Q
What is React?
A
a framework for building interactive UI’s
2
Q
What is a React element?
A
an html element representation in the form of a javascript object. the object has a type property which specifies the element type and a children property which specifies children (if any), and a props property for any attributes.
3
Q
How do you mount a React element to the DOM?
A
first you create a root by calling the createRoot method of the ReactDOM object with the query selected root as the argument.
you then call the render method on the return of ReactDOM.createRoot.
4
Q
what is createRoot()
A
gives ReactDOM full control over the root dom element