
DC-302-Midterm-Quiz

Quiz
•
Computers
•
University
•
Medium
Ian Claros
Used 1+ times
FREE Resource
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>
Create a free account and access millions of resources
Similar Resources on Wayground
15 questions
Informatika

Quiz
•
University
16 questions
HTML Tags

Quiz
•
University
20 questions
La sintassi CSS

Quiz
•
9th Grade - Professio...
20 questions
Examen 1P DAND 23

Quiz
•
University
19 questions
Mobile Systems and Technologies (Input Controls)

Quiz
•
University
14 questions
Year 6 Dig MOD 3 (D)

Quiz
•
6th Grade - University
13 questions
HTML тегтері

Quiz
•
1st Grade - University
15 questions
JavaScript Basics

Quiz
•
12th Grade - University
Popular Resources on Wayground
18 questions
Writing Launch Day 1

Lesson
•
3rd Grade
11 questions
Hallway & Bathroom Expectations

Quiz
•
6th - 8th Grade
11 questions
Standard Response Protocol

Quiz
•
6th - 8th Grade
40 questions
Algebra Review Topics

Quiz
•
9th - 12th Grade
4 questions
Exit Ticket 7/29

Quiz
•
8th Grade
10 questions
Lab Safety Procedures and Guidelines

Interactive video
•
6th - 10th Grade
19 questions
Handbook Overview

Lesson
•
9th - 12th Grade
20 questions
Subject-Verb Agreement

Quiz
•
9th Grade