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/7/en/part7d.md
+10-33Lines changed: 10 additions & 33 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -7,7 +7,7 @@ lang: en
7
7
8
8
<divclass="content">
9
9
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).
11
11
12
12
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.
13
13
@@ -21,7 +21,7 @@ One good piece of advice for both refactoring and writing new code is to take <i
21
21
22
22
<divclass="tasks">
23
23
24
-
### Exercises 7.7.-7.19.
24
+
### Exercises 7.7.-7.20.
25
25
26
26
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.
27
27
@@ -126,7 +126,6 @@ Expand your solution so that it is again possible to like and delete a blog.
126
126
127
127
Use the Context API to manage the data for the logged in user.
128
128
129
-
130
129
#### 7.15: Cleaning the code
131
130
132
131
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
155
154
156
155
Also take the [useField](/en/part7/more_about_react_hooks) hook introduced earlier in this part into use in the forms.
157
156
158
-
### More views
159
-
160
157
The rest of the tasks are common to both the Zustand and React Query versions.
161
158
162
159
#### 7.16: Users view
163
160
164
161
Implement a view to the application that displays all of the basic information related to users:
165
162
166
-

163
+

167
164
168
165
#### 7.17: Individual User View
169
166
170
167
Implement a view for individual users that displays all of the blog posts added by that user:
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
-
```
202
175
203
176
#### 7.18: Comments, step 1
204
177
@@ -218,6 +191,10 @@ Extend your application so that users can add comments to blog posts from the fr
218
191
219
192

220
193
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).
0 commit comments