React Flashcards

1
Q

What is React?

A

React is a JS library for building user interface. It lets you compose complex UIs from small and isolated pieces of code called “components”.

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

What is a React element?

A

React elements are plain objects, and are cheap to create. (An element describes what you want to see on the screen). React elements are IMMUTABLE: once you create an element, you cannot change its children or attributes.

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

Use React.render() and pass the React element and a root DOM node to the render function

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

What is Babel?

A

Babel is a toolchain that is mainly used to convert ECMAScript 2015 + code into a backwards compatible version of JS in current and older browsers or environments.

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

What is a Plug-in?

A

A plug-in is a software component that adds a specific feature to an existing computer program. When a program supports plug-ins, it enables customization.

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

What is a Webpack loader?

A

Loaders are transformations that are applied to the source code of a module. They allow you to preprocess files as you import or “load” them.

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

How can you make Babel and Webpack work together?

A

install loaders that you want to use (e.g. babel-loader) and specify the loaders inside webpack.config.js file

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

What is a React component?

A

Conceptually, components are like JS functions. They accept arbitrary inputs (called “props”) and return React elements describing what should appear on the screen.

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

How do you define a function component in React?

A

Regular ES5 function or ES6 class to define a component.

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

How do you mount a component to the DOM?

A

ReactDOM.render()

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

What are props in React?

A

They are arbitrary inputs passed in to components.

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

How do you pass props to a component?

A

Pass it as JSX attributes and children.

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

How do you write JavaScript expressions in JSX?

A

You surround it with {}. Then you can pass any JS expression as a prop.

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