React Flashcards

1
Q

What is React?

A

A JavaScript library that combines front-end components into JavaScript. (HTML and CSS)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

What is a React element?

A

An object representation of the DOM.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

How do you mount a react element to the dom?

A

ReactDOM.createRoot . render()

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

What is JSX?

A

JSX is a syntax extension for JavaScript that lets you write HTML-like markup inside a JavaScript file.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

Why must the React object be imported when authoring JSX in a module?

A

Because JSX works with React through ReactDOM.createRoot.render()

If you don’t it will be undefined and the call will fail.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

How can you make Webpack and Babel work together to convert JSX into valid Javascript.

A

Use babel-loader, @babel/core, @babel/plugin-transform-react-jsx

How well did you know this?
1
Not at all
2
3
4
5
Perfectly