Search Header Logo

ReactJs Exercise

Authored by Trường Sinh

Information Technology (IT)

University

Used 3+ times

ReactJs Exercise
AI

AI Actions

Add similar questions

Adjust reading levels

Convert to real-world scenario

Translate activity

More...

    Content View

    Student View

10 questions

Show all answers

1.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

React là _____?

Javascript Framework

Javascript Library

Cả A và B đều đúng

Cả A và B đều sai

2.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Hàm được gọi để hiển thị HTML cho một trang web trong React?

reactDOM_render()

render()

render_DOM()

DOM_HTML()

3.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Hook nào trong React được sử dụng để quản lý state trong functional component?

useContext

useReducer

useState

useEffect

4.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Điều gì sẽ xảy ra nếu bạn cập nhật state với cùng giá trị hiện tại?

Component sẽ re-render mỗi lần gọi setState, bất kể giá trị mới giống giá trị cũ.

Component sẽ không re-render nếu giá trị mới giống với giá trị hiện tại.

State sẽ luôn đặt lại về giá trị khởi tạo ban đầu.

React sẽ hiển thị một cảnh báo về việc không nên cập nhật state với giá trị tương tự.

5.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

useEffect hook được sử dụng để làm gì?

Quản lý state

Tạo ra một component mới

Thực hiện side effects trong component

Tối ưu hóa render

6.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Khi nào thì useEffect trong Functional Components của React sẽ chạy lại?

Mỗi khi component cha re-renders.

Chỉ khi các dependencies trong mảng dependencies của useEffect thay đổi.

Chỉ khi component mount lần đầu tiên.

Chỉ khi component được unmount.

7.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

useRef trong React có tác dụng gì?

Giữ trạng thái của component

  • Tạo một biến có thể giữ giá trị qua nhiều lần render mà không kích hoạt render lại

Cập nhật lại component khi giá trị thay đổi

Lưu trữ dữ liệu và truyền đến component con

Access all questions and much more by creating a free account

Create resources

Host any resource

Get auto-graded reports

Google

Continue with Google

Email

Continue with Email

Classlink

Continue with Classlink

Clever

Continue with Clever

or continue with

Microsoft

Microsoft

Apple

Apple

Others

Others

Already have an account?