File tree 1 file changed +2
-2
lines changed
1 file changed +2
-2
lines changed Original file line number Diff line number Diff line change @@ -8,9 +8,9 @@ category: FAQ
8
8
9
9
### 我怎样在 React 中发起 AJAX 请求{#how-can-i-make-an-ajax-call}
10
10
11
- 在React开发中 ,你能使用任何你喜欢的 AJAX 库,比如社区比较流行的 [ Axios] ( https://github.com/axios/axios ) ,[ jQuery AJAX] ( https://api.jquery.com/jQuery.ajax/ ) ,或者是浏览器内置的 [ window.fetch] ( https://developer.mozilla.org/en-US/docs/Web/API/Fetch_API ) 。
11
+ 在 React 开发中 ,你能使用任何你喜欢的 AJAX 库,比如社区比较流行的 [ Axios] ( https://github.com/axios/axios ) ,[ jQuery AJAX] ( https://api.jquery.com/jQuery.ajax/ ) ,或者是浏览器内置的 [ window.fetch] ( https://developer.mozilla.org/en-US/docs/Web/API/Fetch_API ) 。
12
12
13
- ### 我应该在 React组件的哪个生命周期函数中发起 AJAX 请求?{#where-in-the-component-lifecycle-should-i-make-an-ajax-call}
13
+ ### 我应该在 React 组件的哪个生命周期函数中发起 AJAX 请求?{#where-in-the-component-lifecycle-should-i-make-an-ajax-call}
14
14
15
15
我们推荐你在 [ ` componentDidMount ` ] ( /docs/react-component.html#mounting ) 这个生命周期函数中发起 AJAX 请求。这样做你可以拿到 AJAX 请求返回的数据并通过 ` setState ` 来更新组件。
16
16
You can’t perform that action at this time.
0 commit comments