
DC-302-Midterm-Quiz
Authored by Ian Claros
Computers
University
Used 1+ times

AI Actions
Add similar questions
Adjust reading levels
Convert to real-world scenario
Translate activity
More...
Content View
Student View
15 questions
Show all answers
1.
MULTIPLE CHOICE QUESTION
1 min • 1 pt
Which of the following is true about the state in ReactJS?
State is immutable and cannot be changed after being set.
State can only be used in functional components.
State can hold data that may change over time and affect the rendering of the component.
State is used to pass data from a parent component to a child component.
2.
MULTIPLE CHOICE QUESTION
1 min • 1 pt
Which of the following is true about ReactJS components?
A component can return multiple elements without wrapping them in a single container.
Components in React can only be class-based.
A React component must be written in JavaScript and cannot use JSX.
Functional components can use hooks like useState and useEffect to manage state and side effects.
3.
MULTIPLE CHOICE QUESTION
1 min • 1 pt
Which statement is true about props in ReactJS?
Props are mutable and can be changed within the component that receives them.
Props are used to pass data from a child component to a parent component.
Props can be passed to components to allow them to be reused with different inputs.
Props are used to manage the internal state of a component.
4.
MULTIPLE CHOICE QUESTION
1 min • 1 pt
What is the correct way to create a functional component in ReactJS?
function Component { return ( <h1>Hello World!</h1> ); }
function Component() { return ( <h1>Hello World!</h1> ); }
const Component = function() { return <h1>Hello World!</h1>; }
const Component = () => { <h1>Hello World!</h1>; }
5.
MULTIPLE CHOICE QUESTION
1 min • 1 pt
Which of the following is the correct way to initialize and update state in a functional component using React Hooks?
const [count, setCount] = this.state(0);
const count = useState(0); setCount(count + 1);
const [count, setCount] = useState(0); setCount(count + 1);
this.state = { count: 0 }; setCount(count + 1);
6.
MULTIPLE CHOICE QUESTION
1 min • 1 pt
Which of the following correctly uses props in a functional React component?
function Greeting(props) { return <h1>Welcome, {props.name}!</h1>; }
function Greeting() { return <h1>Welcome, props.name!</h1>; }
function Greeting(props) { return <h1>Welcome, this.props.name!</h1>; }
function Greeting(props) { return <h1>Welcome, {name}!</h1>; }
7.
MULTIPLE CHOICE QUESTION
1 min • 1 pt
Which of the following is the correct way to handle an event in a ReactJS functional component?
<button onclick="handleClick()">Click me</button>
<button onClick={handleClick()}>Click me</button>
<button onClick={handleClick}>Click me</button>
<button OnClick={handleClick}>Click me</button>
Access all questions and much more by creating a free account
Create resources
Host any resource
Get auto-graded reports

Continue with Google

Continue with Email

Continue with Classlink

Continue with Clever
or continue with

Microsoft
%20(1).png)
Apple
Others
Already have an account?
Similar Resources on Wayground
11 questions
Latex
Quiz
•
University
18 questions
Juego sobre pseudocódigo en PseInt
Quiz
•
University
20 questions
Python Recap
Quiz
•
7th Grade - University
10 questions
Bài 25 tin 10
Quiz
•
9th Grade - University
12 questions
Microsoft Excel
Quiz
•
University
20 questions
STM 2013 : FORMATIF T3-FORM & REPORT
Quiz
•
University
10 questions
Web Browsing
Quiz
•
10th Grade - Professi...
11 questions
Execl Quiz
Quiz
•
7th Grade - University
Popular Resources on Wayground
15 questions
Fractions on a Number Line
Quiz
•
3rd Grade
20 questions
Equivalent Fractions
Quiz
•
3rd Grade
25 questions
Multiplication Facts
Quiz
•
5th Grade
29 questions
Alg. 1 Section 5.1 Coordinate Plane
Quiz
•
9th Grade
22 questions
fractions
Quiz
•
3rd Grade
11 questions
FOREST Effective communication
Lesson
•
KG
20 questions
Main Idea and Details
Quiz
•
5th Grade
20 questions
Context Clues
Quiz
•
6th Grade
Discover more resources for Computers
12 questions
IREAD Week 4 - Review
Quiz
•
3rd Grade - University
7 questions
Fragments, Run-ons, and Complete Sentences
Interactive video
•
4th Grade - University
7 questions
Renewable and Nonrenewable Resources
Interactive video
•
4th Grade - University
10 questions
DNA Structure and Replication: Crash Course Biology
Interactive video
•
11th Grade - University
5 questions
Inherited and Acquired Traits of Animals
Interactive video
•
4th Grade - University
5 questions
Examining Theme
Interactive video
•
4th Grade - University
20 questions
Implicit vs. Explicit
Quiz
•
6th Grade - University
7 questions
Comparing Fractions
Interactive video
•
1st Grade - University