Skip to content

Commit efabce5

Browse files
committed
7 exercises finetune
1 parent ed9242b commit efabce5

4 files changed

Lines changed: 10 additions & 33 deletions

File tree

src/content/7/en/part7d.md

Lines changed: 10 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ lang: en
77

88
<div class="content">
99

10-
In addition to the six exercises in the [React Hooks](/en/part7/more_about_react_hooks) sections of this part of the course material, 13 exercises continue our work on the BlogList application that we worked on in parts four and five of the course material. Some of the following exercises are "features" that are independent of one another, meaning that there is no need to finish them in any particular order. You are free to skip over a part of the exercises if you wish to do so. Quite many of them are about applying the advanced state management technique (Zustand, React Query and context) covered in [part 6](/en/part6).
10+
In addition to the six exercises in the [React Hooks](/en/part7/more_about_react_hooks) sections of this part of the course material, 14 exercises continue our work on the BlogList application that we worked on in parts four and five of the course material. Some of the following exercises are "features" that are independent of one another, meaning that there is no need to finish them in any particular order. You are free to skip over a part of the exercises if you wish to do so. Quite many of them are about applying the advanced state management technique (Zustand, React Query and context) covered in [part 6](/en/part6).
1111

1212
If you do not want to use your BlogList application, you are free to use the code from the model solution as a starting point for these exercises.
1313

@@ -21,7 +21,7 @@ One good piece of advice for both refactoring and writing new code is to take <i
2121

2222
<div class="tasks">
2323

24-
### Exercises 7.7.-7.19.
24+
### Exercises 7.7.-7.20.
2525

2626
These exercises assume that you have already completed the exercises [5.24-5.29](/en/part5/react_router_ui_frameworks#exercises-5-24-5-29). If you have not, do those first.
2727

@@ -126,7 +126,6 @@ Expand your solution so that it is again possible to like and delete a blog.
126126
127127
Use the Context API to manage the data for the logged in user.
128128
129-
130129
#### 7.15: Cleaning the code
131130
132131
Your application most likely contains code that handles the logged-in user via <i>localStorage</i> in several places:
@@ -155,50 +154,24 @@ Replace all direct <i>localStorage</i> access in the application with calls to t
155154
156155
Also take the [useField](/en/part7/more_about_react_hooks) hook introduced earlier in this part into use in the forms.
157156
158-
### More views
159-
160157
The rest of the tasks are common to both the Zustand and React Query versions.
161158
162159
#### 7.16: Users view
163160
164161
Implement a view to the application that displays all of the basic information related to users:
165162
166-
![browser blogs with users table showing blogs created](../../images/7/41.png)
163+
![browser blogs with users table showing blogs created](../../images/7/b5.png)
167164
168165
#### 7.17: Individual User View
169166
170167
Implement a view for individual users that displays all of the blog posts added by that user:
171168
172-
![browser blogs showing users added blogs](../../images/7/44.png)
169+
![browser blogs showing users added blogs](../../images/7/b6.png)
173170
174171
You can access this view by clicking the name of the user in the view that lists all users:
175172
176-
![browser blogs showing clickable users](../../images/7/43.png)
177-
178-
<i>**NB:**</i> you will almost certainly stumble across the following error message during this exercise:
179-
180-
![browser TypeError cannot read property name of undefined](../../images/7/42ea.png)
173+
![browser blogs showing clickable users](../../images/7/b7.png)
181174
182-
The error message will occur if you refresh the individual user page.
183-
184-
The cause of the issue is that, when we navigate directly to the page of an individual user, the React application has not yet received the data from the backend. One solution for this problem is to use conditional rendering:
185-
186-
```js
187-
const User = () => {
188-
const user = ...
189-
// highlight-start
190-
if (!user) {
191-
return null
192-
}
193-
// highlight-end
194-
195-
return (
196-
<div>
197-
// ...
198-
</div>
199-
)
200-
}
201-
```
202175
203176
#### 7.18: Comments, step 1
204177
@@ -218,6 +191,10 @@ Extend your application so that users can add comments to blog posts from the fr
218191
219192
![browser showing comments added via frontend](../../images/7/49.png)
220193
221-
This was the last exercise for this part of the course and it's time to push your code to GitHub and mark all of your finished exercises to the [exercise submission system](https://studies.cs.helsinki.fi/stats/courses/fullstackopen).
194+
#### 7.20: Styling
195+
196+
Improve the visual appearance of the new features of your application using the techniques covered in [part 5](/en/part5/react_router_ui_frameworks).
197+
198+
This was the last exercise for this part of the course and it's time to push your code to GitHub and mark all of your completed exercises to the [exercise submission system](https://studies.cs.helsinki.fi/stats/courses/fullstackopen).
222199
223200
</div>

src/content/images/7/b5.png

90.3 KB
Loading

src/content/images/7/b6.png

89.4 KB
Loading

src/content/images/7/b7.png

90.3 KB
Loading

0 commit comments

Comments
 (0)