React Flashcards

1
Q

What is Reactjs?

A

React is a JavaScript library that makes building user interfaces easy. It was developed
by Facebook.

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

Does React use HTML?

A

No, It uses JSX, JavaScript XML. which is similar to HTML.

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

most significant drawbacks of React

A

there is no predefined way to structure your app

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

State the difference between Real DOM and Virtual DOM

A

.Real DOM Virtual DOM
It is updated slowly.It allows a direct update from HTML. It wastes too much memory.

.Virtual DOM
It updates faster.It cannot be used to update HTML
directly.Memory consumption is less

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

What is Flux Concept In React?

A

Flux is a pattern for managing how data flows through a React application.
There are three distinct roles for dealing with data in the flux methodology:
Dispatcher, Stores,Views

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

Define the term Redux in React

A

Redux is a library used for front end development. It is a state container for JavaScript
applications which should be used for the applications state management. You can test
and run an application developed with Redux in different environments.

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

What is the ‘Store’ feature in Redux?

A

Redux has a feature called ‘Store’ which allows you to save the application’s entire State
at one place. Therefore all it’s component’s State are stored in the Store so that you will
get regular updates directly from the Store. The single state tree helps you to keep track
of changes over time and debug or inspect the application.

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

What is an action in Redux?

A

Actions are plain JavaScript object that contains information.
. The action-type and the action data are always stored in the action object.

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

When was React first released?

A

React was first released on March 2013.

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

Name the important features of React

A

Virtual Dom
single page applications
SEO friendly with ssr
JSX
Component Driven

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

Explain the term stateless components

A

Stateless components are pure functions that render DOM-based solely on the
properties provided to them.

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

What is dispatcher?

A

A dispatcher is a central hub of app where you will receive actions and broadcast
payload to registered callbacks.

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

What is meant by callback function? What is its purpose?

A

A callback function should be called when setState has finished, and the component is
retendered. As the setState is asynchronous, which is why it takes in a second callback
function.

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

Explain the term high order component

A

A higher-order component also shortly known as HOC is an advanced technique for
reusing component logic. It is not a part of the React API, but they are a pattern which
emerges from React’s compositional nature.

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

What are Props in react js?

A

Props mean properties, which is a way of passing data from parent to child. We can say
that props are just a communication channel between components. It is always moving
from parent to child component.

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

Name two types of React component

A

Two types of react Components are:
Function component
Class component

17
Q

synthetic event in React js

A

Synthetic event is a kind of object which acts as a cross-browser wrapper around the
browser’s native event. It also helps us to combine the behaviors of various browser into
signal API.

18
Q

What is React State?

A

The state is a built-in React object that is used to contain data or information about the component. A component’s state can change over time; whenever it changes, the component re-renders.

19
Q

Explain the use of ‘key’ in react list

A

Keys allow you to provide each list element with a stable identity. The keys should be
unique.

20
Q

Explain error boundaries?

A

Only class components can be error boundaries.
Error boundaries are React components that catch JavaScript errors anywhere in their child component tree, log those errors, and display a fallback UI instead of the component tree that crashed. Error boundaries catch errors during rendering, in lifecycle methods, and in constructors of the whole tree below them.

21
Q

Explain strict mode

A

StrictMode allows you to run checks and warnings for react components. It runs only on
development build. It helps you to highlight the issues without rendering any visible UI.

22
Q

What is portal in React with example?

A

Portals provide a first-class way to render children into a DOM node that exists outside the DOM hierarchy of the parent component.

23
Q

What is Context?

A

React context helps you to pass data using the tree of react components. It helps you to
share data globally between various react components.

24
Q

What is the use of Webpack?

A

Webpack in basically is a module builder. It is mainly runs during the development
process.

25
Q

What is Babel in React js?

A

Babel, is a JavaScript compiler that converts latest JavaScript like ES6, ES7 into plain
old ES5 JavaScript that most browsers understand.

26
Q

How can a browser read JSX file?

A

If you want the browser to read JSX, then that JSX file should be replaced using a JSX
transformer like Babel and then send back to the browser.

27
Q

Can you update props in react?

A

You can’t update props in react js because props are read-only. Moreover, you can not
modify props received from parent to child.

28
Q

Can you update the values of props?

A

It is not possible to update the value of props as it is immutable.