Skip to content

Commit 756f70b

Browse files
authored
Merge pull request #2840 from romanstetsyk/part2c-links
update links to react docs for part2c
2 parents 7aa385d + 3c028d8 commit 756f70b

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/content/2/en/part2c.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -362,7 +362,7 @@ What's not immediately obvious, however, is where the command <em>axios.get</em>
362362

363363
### Effect-hooks
364364

365-
We have already used [state hooks](https://reactjs.org/docs/hooks-state.html) that were introduced along with React version [16.8.0](https://www.npmjs.com/package/react/v/16.8.0), which provide state to React components defined as functions - the so-called <i>functional components</i>. Version 16.8.0 also introduces [effect hooks](https://reactjs.org/docs/hooks-effect.html) as a new feature. As per the official docs:
365+
We have already used [state hooks](https://react.dev/learn/state-a-components-memory) that were introduced along with React version [16.8.0](https://www.npmjs.com/package/react/v/16.8.0), which provide state to React components defined as functions - the so-called <i>functional components</i>. Version 16.8.0 also introduces [effect hooks](https://reactjs.org/docs/hooks-effect.html) as a new feature. As per the official docs:
366366

367367
> <i>The Effect Hook lets you perform side effects on function components.</i>
368368
> <i>Data fetching, setting up a subscription, and manually changing the DOM in React components are all examples of side effects.</i>
@@ -474,7 +474,7 @@ const hook = () => {
474474
useEffect(hook, [])
475475
```
476476

477-
Now we can see more clearly that the function [useEffect](https://reactjs.org/docs/hooks-reference.html#useeffect) takes <i>two parameters</i>. The first is a function, the <i>effect</i> itself. According to the documentation:
477+
Now we can see more clearly that the function [useEffect](https://react.dev/reference/react/useEffect) takes <i>two parameters</i>. The first is a function, the <i>effect</i> itself. According to the documentation:
478478

479479
> <i>By default, effects run after every completed render, but you can choose to fire it only when certain values have changed.</i>
480480
@@ -585,6 +585,6 @@ Error: listen EADDRINUSE 0.0.0.0:3001
585585

586586
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.
587587

588-
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).
588+
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://react.dev/reference/react/useEffect).
589589

590590
</div>

0 commit comments

Comments
 (0)