React Flashcards

1
Q

How should a component update its props?

A

Never directly. A change handler function should be passed down through props.

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

What does the effect hook replace?

A

Component lifecycle methods

mounting
updating
unmounting

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

This is a syntax extension for JavaScript to allow HTML in the form of expressions

A

JSX

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

HTML or JSX attributes which trigger a function upon a certain action

A

Event listeners

Examples
onClick
onChange

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

Does JS logic belong inside or above a component’s return statement?

A

Above

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

A component returned inside another component

A

Instance

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

What is the meat of an open component instance called and how is it rendered inside?

A

const ChildComponent = (props) => {
return (
{ props.children }
)
}

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

How do you assign .defaultProps?

A

After the function component:

ComponentName.defaultProps = {
property: value
}

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

This hook replaces the getter and setter methods for state in a functional component

A

useState()

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

A function called inside of another function

A

Callback Function

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

Higher Order Function

A

Takes a callback function as argument

eg. arr.map(num => num * 2)

.map is a higher order function

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