Skip to content

Commit 3574031

Browse files
authored
Merge pull request #2648 from Sevichecc/patch-1
Fix missing close tag
2 parents 0c9e5bf + 910535a commit 3574031

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

src/content/2/zh/part2c.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -348,7 +348,7 @@ console.log(promise2)
348348
Mozilla网站上的文档对承诺有如下说明。
349349

350350
<!-- > <i>A Promise is an object representing the eventual completion or failure of an asynchronous operation.</i>-->
351-
> <i>A Promise是一个代表异步操作最终完成或失败的对象。
351+
> <i>A Promise是一个代表异步操作最终完成或失败的对象。</i>
352352
353353
<!-- In other words, a promise is an object that represents an asynchronous operation. A promise can have three distinct states:-->
354354
换句话说,一个承诺是一个代表异步操作的对象。一个承诺可以有三种不同的状态。
@@ -445,7 +445,7 @@ axios.get('http://localhost:3001/notes').then(response => {
445445
<!-- > <i>The Effect Hook lets you perform side effects on function components.</i>-->
446446
> <i>效果钩可以让你对函数组件执行副作用。</i>。
447447
<!-- > <i>Data fetching, setting up a subscription, and manually changing the DOM in React components are all examples of side effects.</i>-->
448-
> <i>获取数据、设置订阅、以及手动改变React组件中的DOM都是副作用的例子。
448+
> <i>获取数据、设置订阅、以及手动改变React组件中的DOM都是副作用的例子。</i>
449449
450450
<!-- As such, effect hooks are precisely the right tool to use when fetching data from a server.-->
451451
因此,当从服务器获取数据时,效果钩子正是正确的工具。
@@ -569,13 +569,13 @@ useEffect(hook, [])
569569
现在我们可以更清楚地看到,函数[useEffect](https://reactjs.org/docs/hooks-reference.html#useeffect)实际上需要<i>两个参数</i>。第一个是一个函数,即<i>effect</i>本身。根据文档的内容。
570570

571571
<!-- > <i>By default, effects run after every completed render, but you can choose to fire it only when certain values have changed.</i>-->
572-
> <i>默认情况下,效果会在每次完成渲染后运行,但你可以选择只在某些值发生变化时启动它。
572+
> <i>默认情况下,效果会在每次完成渲染后运行,但你可以选择只在某些值发生变化时启动它。</i>
573573
574574
<!-- So by default the effect is <i>always</i> run after the component has been rendered. In our case, however, we only want to execute the effect along with the first render.-->
575575
所以默认情况下,效果是<i>总是</i>在组件被渲染后运行。然而,在我们的例子中,我们只想在第一次渲染时执行效果。
576576

577577
<!-- The second parameter of <em>useEffect</em> is used to [specify how often the effect is run](https://reactjs.org/docs/hooks-reference.html#conditionally-firing-an-effect). If the second parameter is an empty array <em>[]</em>, then the effect is only run along with the first render of the component.-->
578-
<em>useEffect</em>的第二个参数用于[指定效果的运行频率](https://reactjs.org/docs/hooks-reference.html#conditionally-firing-an-effect)。如果第二个参数是一个空的数组<em>[]<em>,那么效果就只在组件的第一次渲染时运行。
578+
<em>useEffect</em>的第二个参数用于[指定效果的运行频率](https://reactjs.org/docs/hooks-reference.html#conditionally-firing-an-effect)。如果第二个参数是一个空的数组<em>[]</em>,那么效果就只在组件的第一次渲染时运行。
579579

580580
<!-- There are many possible use cases for an effect hook other than fetching data from the server. However, this use is sufficient for us, for now.-->
581581
除了从服务器上获取数据之外,效果钩子还有许多可能的使用情况。然而,目前这个用途对我们来说已经足够了。
@@ -695,7 +695,7 @@ Error: listen EADDRINUSE 0.0.0.0:3001
695695
<!-- it means that port 3001 is already in use by another application, e.g. in use by an already running json-server. Close the other application, or change the port in case that doesn't work.-->
696696
这意味着3001端口已经被另一个应用使用,例如,被一个已经运行的json-server使用。关闭另一个应用,或者改变端口,如果这不起作用的话。
697697

698-
<!-- Modify the application such that the initial state of the data is fetched from the server using the <i>axios</i>-library. Complete the fetching with an [Effect hook](https://reactjs.org/docs/hooks-effect.html).-->
698+
<!-- Modify the application such that the initial state of the data is fetched from the server using the <i>axios</i>-library. Complete the fetching with an [Effect hook](https://reactjs.org/docs/hooks-effect.html). -->
699699
修改应用,使数据的初始状态是使用<i>axios</i>-library从服务器获取的。用一个[效果钩子](https://reactjs.org/docs/hooks-effect.html)来完成获取。
700700

701701
<h4>2.12* Data for countries, step1</h4>

0 commit comments

Comments
 (0)