diff --git a/content/docs/hooks-faq.md b/content/docs/hooks-faq.md index 12e1db0b7..a61e99e9c 100644 --- a/content/docs/hooks-faq.md +++ b/content/docs/hooks-faq.md @@ -610,7 +610,7 @@ function ProductPage({ productId }) { This also allows you to handle out-of-order responses with a local variable inside the effect: -```js{2,6,8} +```js{2,6,10} useEffect(() => { let ignore = false; async function fetchProduct() { @@ -618,6 +618,8 @@ This also allows you to handle out-of-order responses with a local variable insi const json = await response.json(); if (!ignore) setProduct(json); } + + fetchProduct(); return () => { ignore = true }; }, [productId]); ``` diff --git a/content/docs/thinking-in-react.md b/content/docs/thinking-in-react.md index 59e4c192e..7164e1a07 100644 --- a/content/docs/thinking-in-react.md +++ b/content/docs/thinking-in-react.md @@ -41,7 +41,7 @@ Vì mô hình dữ liệu thường hiển thị dưới dạng chuỗi JSON, n ![Sơ đồ Component](../images/blog/thinking-in-react-components.png) -Trong ứng dụng đơn giản dưới đây, bạn sẽ thấy chúng ta có 5 component, dữ liệu mà mỗi component hiển thị sẽ được in nghiêng +Trong ứng dụng dưới đây, bạn sẽ thấy chúng ta có 5 component, dữ liệu mà mỗi component hiển thị sẽ được in nghiêng 1. **`FilterableProductTable` (orange):** chứa toàn bộ cả ứng dụng 2. **`SearchBar` (blue):** nơi *người dùng nhập từ khoá tìm kiếm*