day09

day09

University

30 Qs

quiz-placeholder

Similar activities

PENILAIAN HARIAN I TIK KELAS XII

PENILAIAN HARIAN I TIK KELAS XII

University

30 Qs

MSC QUIZ

MSC QUIZ

University

30 Qs

Social Quiz - Social influence and personal control

Social Quiz - Social influence and personal control

University

26 Qs

AppDev (Finals)

AppDev (Finals)

University

28 Qs

[Tin Học 7]

[Tin Học 7]

7th Grade - University

28 Qs

React - Introdução

React - Introdução

12th Grade - University

27 Qs

Mobile App 1 (Quiiz 1 - Finals)

Mobile App 1 (Quiiz 1 - Finals)

University

30 Qs

ISA - Midterm Exam NOT FINAL

ISA - Midterm Exam NOT FINAL

University

30 Qs

day09

day09

Assessment

Passage

Other

University

Medium

Created by

Gnanavel Durairaj

Used 1+ times

FREE Resource

30 questions

Show all answers

1.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What is the main purpose of the useId hook in React?

Generate unique IDs for accessibility

Manage state in functional components

Handle API requests

Optimize component re-renders

2.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

When does React typically reset useId?

On every render

On component mount only

Only if dependencies change

Never

3.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Which is the correct way to use useId in TypeScript?

const id = useId();

<label htmlFor={id}>Enter Name</label>

<input id={id} type="text" />

Correct

Incorrect

4.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What does useId return?

A function

A unique string ID

A state variable

A JSX element

5.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What is the key difference between useEffect and useLayoutEffect?

useLayoutEffect runs after paint, useEffect runs before paint

useEffect runs after the render, useLayoutEffect runs before paint

Both run at the same time

useLayoutEffect runs asynchronously

6.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

When should useLayoutEffect be preferred over useEffect?

When updating the DOM immediately after render

When fetching API data

When setting up event listeners

When logging data to the console

7.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Does useLayoutEffect run on the server side?

Yes

No

Create a free account and access millions of resources

Create resources
Host any resource
Get auto-graded reports
or continue with
Microsoft
Apple
Others
By signing up, you agree to our Terms of Service & Privacy Policy
Already have an account?