Intro Flashcards

1
Q

When was react created? Who created it?

A

Created on 2011 by Facebook.

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

Why react?

A
Flexibility;
Developer experience;
Corporate investment;
Community support;
Performance;
Testability;
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

Is react a framework? What are examples of frameworks?

A

React is a library. Angular and ember are frameworks.

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

Where react can be used?

A

Web apps, static sites, mobo apps through react native and desktop apps using electron.
“Learn once and use it everywhere”.

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

Can react be rendered only in the client side?

A

No… can be rendered in the server side by using next.js or gatsby or phenomic.

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

What are react renderers?

A

libs that renders react: react-dom, react-native and react-vr… there are many others..

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

Can react slowly replace existing web app components?

A

Yes… this is how facebook did to slowly replace all the components.

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

How react can be used to create components?

A

By simply receiving props and returning HTML or by creating a class that extends React.Component and then implement the method render(){

}

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

What is JSX? What does it stands for? What does it do?

A

JSX allows us to write HTML elements in JavaScript and place them in the DOM without any createElement() and/or appendChild() methods.

Stands for JavaScript XML.

JSX converts HTML tags into react elements.

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

What is the most popular way to create a react app?

A

By using create-react-app

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

How to start a react app?

A

By using npm start.

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

What happens when you make a mistake in the html syntax for example?

A

React shows a detailed message.

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

What does the debugger statement do in react?

A

It makes the browser stop in the breakpoint.

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

What is a codemod? What does it do? How many components does it cover by default on Facebook?

A

Used to upgrade react versions. Easily resolve breaking changes by running a script. 50k components are migrated using codemod.

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

Are there existing react components available out-of-the-box? Who are the three main publishers? Are there community-based react components? Where to find?

A

Yes. Fabric (MS), Material-UI (Google) and React Bootstrap (Twitter). Yes, find on enaqx/awesome-ract.

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

What is the concept of a Virtual DOM on react? Why does it exist? How does it work?

A

React minimizes DOM changes. Because updating the DOM is expensive. It is based on component states, only updates when the state updates.

17
Q

What is the so called “layout thrash”? What is the effect of avoiding it by using React and its Virtual DOM?

A

When the browser has to recalculate the position of everything when a dom element changes. It saves performance and therefore battery and CPU.

18
Q

What is the size of react and react dom? What are other react-like options that prioritizes the size?

A

35KB with gzip. Inferno (9kB) and preact (3kB).

19
Q

How does React perform in the testability perspective?

A

It has an outstanding performance in testing: there is almost no need to ui tests, only unit tests… everything can be done in memory using nodejs.

20
Q

What is the most popular unit testing framework for javascript?

A

JEST.

21
Q

What is JEST snapshot?

A

Keeps the rendered components in memory so that it re-uses it.

22
Q

React features against angular.

A

https://pasteboard.co/JdJHiqr.png

23
Q

What is react?

A

React is a declarative, efficient, and flexible JavaScript library for building user interfaces. It lets you compose complex UIs from small and isolated pieces of code called “components”.