Basics Flashcards

1
Q

What is React ?

A

It is JavaScript Library to create websites, allows us to create single page apps

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

Create react app

A

npx create-react-app websitename

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

What is react hooks

A

React hooks are the built-in functions that permit the use state and life cycle methods in react components.

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

.map() array method does what?

A

.map() modifies existing array and returns new array

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

What are props

A

Props are passed to components just as arguments to functions

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

Render() in react

A

Every component in react has to return HTML. Render() is used for this

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

What is store

A

Store is single source of truth and it includes the entire application state

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

Declare constant in react

A

Export const var_name = “value”

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

JSON.stringify(obj)

A

Converts from a JavaScript value to a JSON string

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

Hook rules

A

1.Cannot be conditional
2. Can only be called at the top level of component
3.Can only be called inside react function components.

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

Higher-order components

A

1.Acts as a container for other components.
2.Keeps components simple and reusable.
3.Acts as a decorator for components and adds functionality

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