Câu hỏi

Khi nào nên sử dụng forceUpdate trong một React component?

senior
Hide Answers detail

Thỉnh thoảng bạn muốn cập nhập lại Component một cách thủ công, điều này có thể đạt được bằng cách sử dụng phương thức forceUpdate(). Đây là một phương thức của lớp React.Component, vì vậy các lớp con của React.Component sẽ được thừa kế phương thức này.

Ví dụ:

```js // file forceUpdate-example.jsx class R...

You need to login to view

Suggest other questions

React Fiber là gì?

See the answer detail

Sự khác biệt chính về kiến trúc giữa JavaScript library như React và JavaScript framework như Angular là gì?

See the answer detail

Làm thế nào để việc render của React hoạt động chính xác khi chúng ta gọi setState?

See the answer detail

Làm thế nào để tránh việc cần phải binding trong React?

See the answer detail

Làm thế nào để sử dụng Polymer trong ReactJS?

See the answer detail