You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: src/content/1/fi/osa1d.md
+5-5Lines changed: 5 additions & 5 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -10,9 +10,9 @@ lang: fi
10
10
11
11
### Huomio Reactin versioista
12
12
13
-
Version 18 of React was released late March 2022. The code in material should work as it is with the new React version. However, some libraries might not yet be compatible with React 18. At the moment of writing (4th April) at least the Apollo client used in [part 8](/en/part8) does not yet work with most recent React.
13
+
Reactin uusin versio 18 julkaistiin maaliskuun 2022 lopussa. Materiaalin koodin pitäisi toimia sellaisenaan uudenkin Reactin kanssa poislukien [osassa 8](/osa8) käytettävää Apollo Clientiä.
14
14
15
-
In case you end up in a situation where your application breaks because of library compatibly problems, <i>downgrade</i> to the older React by changing the file <i>package.json</i> as follows:
15
+
Jos törmäät ongelmiin voit downgreidata projektin vanhempaan Reactiin muuttamalla tiedostoa <i>package.json</i> seuraavasti:
16
16
17
17
```js
18
18
{
@@ -26,13 +26,13 @@ In case you end up in a situation where your application breaks because of libra
26
26
}
27
27
```
28
28
29
-
After the change is made, reinstall dependencies by running
29
+
ja asentamalla muutoksen jälkeen riippuvuudet uudelleen suorittamalla komento
30
30
31
31
```js
32
32
npm install
33
33
```
34
34
35
-
Note that also the file <i>index.js</i> needs to be changed a bit. For React 17 it looks like
35
+
Huomaa, että myös tiedosto <i>index.js</i> eroaa hieman eri Reactin versiossa. React 17:lla se näyttää seuraavalta
Copy file name to clipboardExpand all lines: src/content/5/en/part5b.md
-2Lines changed: 0 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -374,10 +374,8 @@ const App = () => {
374
374
}
375
375
```
376
376
377
-
<!-- Vastaava muutos voitaisiin tehdä myös kirjautumislomakkeelle, mutta jätämme sen vapaaehtoiseksi harjoitustehtäväksi. -->
378
377
We could do the same for the log in form, but we'll leave that for an optional exercise.
379
378
380
-
<!-- Sovelluksen tämänhetkinen koodi on kokonaisuudessaan [githubissa](https://github.com/fullstack-hy2020/part2-notes/tree/part5-5), branchissa <i>part5-5</i>. -->
381
379
The application code can be found from [github](https://github.com/fullstack-hy2020/part2-notes/tree/part5-5),
Copy file name to clipboardExpand all lines: src/content/6/en/part6a.md
+11-4Lines changed: 11 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -179,7 +179,9 @@ would cause the following to be printed
179
179
The code of our counter application is the following. All of the code has been written in the same file, so <i>store</i> is straight available for the React-code. We will get to know better ways to structure React/Redux-code later.
@@ -239,7 +239,7 @@ Is there a bug in our code? No. The combined reducer works in such a way that ev
239
239
Let's finish the application so that it uses the combined reducer. We start by changing the rendering of the application and hooking up the store to the application in the <i>index.js</i> file:
@@ -251,8 +251,6 @@ Next, let's fix a bug that is caused by the code expecting the application store
251
251
252
252

253
253
254
-
255
-
<!-- Korjaus on helppo. Koska muistiinpanot ovat nyt storen kentässä <i>notes</i>, riittää pieni muutos selektorifunktioon: -->
256
254
It's an easy fix. Because the notes are in the store's field <i>notes</i>, we only have to make a little change to the selector function:
257
255
258
256
```js
@@ -414,7 +412,8 @@ npm install @reduxjs/toolkit
414
412
Next, open the <i>index.js</i> file which currently creates the Redux store. Instead of Redux's <em>createStore</em> function, let's create the store using Redux Toolkit's [configureStore](https://redux-toolkit.js.org/api/configureStore) function:
Copy file name to clipboardExpand all lines: src/content/6/fi/osa6a.md
+12-6Lines changed: 12 additions & 6 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -176,7 +176,9 @@ tulostaisi
176
176
Laskurisovelluksemme koodi on seuraavassa. Kaikki koodi on kirjoitettu samaan tiedostoon, joten <i>store</i> on suoraan React-koodin käytettävissä. Tutustumme React/Redux-koodin parempiin strukturointitapoihin myöhemmin.
Avataan sen jälkeen <i>index.js</i>-tiedosto, jossa nykyinen Redux-store luodaan. Käytetään storen luonnissa Reduxin <em>createStore</em>-funktion sijaan Redux Toolkitin [configureStore](https://redux-toolkit.js.org/api/configureStore)-funktiota:
Each view is implemented as its own component. We store the view component information in the application state called <i>page</i>. This information tells us which component, representing a view, should be shown below the menu bar.
@@ -426,7 +426,7 @@ One way to do this would be to use React Router's [useMatch](https://reactrouter
426
426
It is not possible to use the <i>useMatch</i> hook in the component which defines the routed part of the application. Let's move the use of the _Router_ components from _App_:
0 commit comments