
react
Quiz
•
Science, Professional Development, Computers
•
University
•
Practice Problem
•
Hard
Nghia Ngoc
Used 10+ times
FREE Resource
Enhance your content in a minute
9 questions
Show all answers
1.
MULTIPLE CHOICE QUESTION
10 sec • 5 pts
What is the second argument for setState useful for?
To invoke code after the setState operation is done
To replace the state completely instead of the default merge action
To access the previous state before the setState operation
None of the above
2.
MULTIPLE CHOICE QUESTION
10 sec • 5 pts
How do you invoke setDone only when component mounts, using hooks?
useEffect(() => { setDone(true);
});
useEffect(() => { setDone(true);
}, []);
useEffect(() => { setDone(true);
}, [setDone]);
useEffect(() => { setDone(true);
}, [done, setDone]);
3.
MULTIPLE CHOICE QUESTION
10 sec • 5 pts
Which Hook could be used to update the document's title?
useEffect(function updateTitle() { document.title = name + ' ' + lastname; });
useEffect(() => { title = name + ' ' + lastname;
});
useEffect(function updateTitle() { name + ' ' + lastname;
});
useEffect(function updateTitle() {
title = name + ' ' + lastname;
});
4.
MULTIPLE CHOICE QUESTION
5 sec • 5 pts
Will useEffect affect other data?
True
False
5.
MULTIPLE CHOICE QUESTION
20 sec • 5 pts
If a function component should always render the same way given the same props, what is a simple performance optimization available for it?
Wrap it in the React.memo higher-order component.
Implement the useReducer Hook.
Implement the shouldComponentUpdate lifecycle method.
Implement the useMemo Hook.
6.
MULTIPLE CHOICE QUESTION
10 sec • 5 pts
When do you use useLayoutEffect?
to optimize for all devices
to complete the update
to change the layout of the screen
when you need the browser to paint after the effect runs
7.
MULTIPLE CHOICE QUESTION
10 sec • 5 pts
Why might you use useReducer over useState in a React component?
when you have complex state logic that involves multiple sub-values
when you want to break your production app
when you like =)))
can not be replaced
8.
MULTIPLE CHOICE QUESTION
30 sec • 5 pts
If you see the following import in a file, what is being used for state management in the component?
import React, {useState} from 'react';
stateful components
class components
math
React Hooks
9.
MULTIPLE CHOICE QUESTION
30 sec • 5 pts
How do you handle passing through the component tree without having to pass props down manually at every level?
React Send
React Pinpoint
React Router
React Context
Similar Resources on Wayground
10 questions
CSE205-DCN-QUIZ-UNIT-5
Quiz
•
University
10 questions
Day 15 Assessment -Encapsulation & Abstraction, Exception-28June
Quiz
•
University
12 questions
Data Science Quiz
Quiz
•
University
10 questions
RAID
Quiz
•
University
10 questions
Layers of the Atmosphere Quiz
Quiz
•
7th Grade - University
10 questions
Microcontroller
Quiz
•
11th Grade - University
10 questions
US-Indonesia Cooperation in Environmental Issues
Quiz
•
10th Grade - University
14 questions
Acids and bases are all around
Quiz
•
University
Popular Resources on Wayground
5 questions
This is not a...winter edition (Drawing game)
Quiz
•
1st - 5th Grade
25 questions
Multiplication Facts
Quiz
•
5th Grade
10 questions
Identify Iconic Christmas Movie Scenes
Interactive video
•
6th - 10th Grade
20 questions
Christmas Trivia
Quiz
•
6th - 8th Grade
18 questions
Kids Christmas Trivia
Quiz
•
KG - 5th Grade
11 questions
How well do you know your Christmas Characters?
Lesson
•
3rd Grade
14 questions
Christmas Trivia
Quiz
•
5th Grade
20 questions
How the Grinch Stole Christmas
Quiz
•
5th Grade
Discover more resources for Science
26 questions
Christmas Movie Trivia
Lesson
•
8th Grade - Professio...
20 questions
christmas songs
Quiz
•
KG - University
20 questions
Holiday Trivia
Quiz
•
9th Grade - University
15 questions
Holiday Movies
Quiz
•
University
14 questions
Christmas Trivia
Quiz
•
3rd Grade - University
20 questions
Christmas Trivia
Quiz
•
University
8 questions
5th, Unit 4, Lesson 8
Lesson
•
KG - Professional Dev...
20 questions
Disney Trivia
Quiz
•
University
