Skip to content

Commit bb95ef4

Browse files
committed
Include full code for the initial counter application
The code that was provided for the counter application wasn't complete as it missed the export. So, to make it easier for those who follow the examples, add the complete code
1 parent 3d54771 commit bb95ef4

File tree

2 files changed

+6
-0
lines changed

2 files changed

+6
-0
lines changed

src/content/7/en/part7b.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@ We implemented a counter application in [part 1](/en/part1/component_state_event
4242

4343
```js
4444
import { useState } from 'react'
45+
4546
const App = () => {
4647
const [counter, setCounter] = useState(0)
4748

@@ -60,6 +61,8 @@ const App = () => {
6061
</div>
6162
)
6263
}
64+
65+
export default App
6366
```
6467

6568
Let's extract the counter logic into a custom hook. The code for the hook is as follows:

src/content/7/fi/osa7b.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@ Teimme [osassa 1](/osa1/komponentin_tila_ja_tapahtumankasittely#tapahtumankasitt
4747

4848
```js
4949
import { useState } from 'react'
50+
5051
const App = () => {
5152
const [counter, setCounter] = useState(0)
5253

@@ -65,6 +66,8 @@ const App = () => {
6566
</div>
6667
)
6768
}
69+
70+
export default App
6871
```
6972

7073
Eriytetään laskurilogiikka custom-hookiksi. Hookin koodi on seuraava:

0 commit comments

Comments
 (0)