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
docs: add FAQ section to hooks-and-routing task based on student ques… (#1822)
* docs: add FAQ section to hooks-and-routing task based on student questions
* docs: add FAQ section to hooks-and-routing task based on student questions -2
Copy file name to clipboardExpand all lines: react/modules/tasks/functional-routing.md
+39Lines changed: 39 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -54,6 +54,45 @@ Focus on routing and functional components. Remove any button or functionality w
54
54
55
55
A student can achieve a maximum of 100 points.
56
56
57
+
## 📚 FAQ (Frequently Asked Questions)
58
+
59
+
### ❓ Should the `page` parameter always be in the URL?
60
+
61
+
Yes. Even if no search term or details are selected, the current page should always be reflected in the URL, e.g., `?page=1`.
62
+
63
+
### ❓ Does "Pagination is present in both URL and on the page" mean synchronization?
64
+
65
+
Yes. The page number in the URL must match the visible pagination state. If the user clicks to go to page 3, the URL should change to `?page=3`.
66
+
67
+
### ❓ Should we use `<Outlet>` for the details section?
68
+
69
+
Yes. As described in the Master-Detail requirement, the details section should be implemented using React Router’s `<Outlet>`.
70
+
71
+
### ❓ What if the About page exists but is not linked anywhere?
72
+
73
+
It is considered partially implemented. For full points, the About page must exist **and** be accessible via a navigation link from the main app.
74
+
75
+
### ❓ My 404 page works on the deployed site, but not on localhost. Is that okay?
76
+
77
+
No. The 404 page must work **locally**, since cross-checking is done using `localhost`. GitHub Pages or other hosts may override your 404 behavior.
78
+
79
+
### ❓ Do I need to pass the search query in the URL?
80
+
81
+
Only if you want to. It's not required in the task, but you're free to include it as a `search` query param (e.g., `?page=1&search=pikachu`). It's not part of the scoring though.
82
+
83
+
### ❓ Can I use `useSearchParams` or `useParams`?
84
+
85
+
Yes. You can choose either or both depending on your routing strategy.
86
+
87
+
### ❓ What should I put in the `details` param?
88
+
89
+
You should pass the ID (or identifier) of the selected item from the search results, e.g., `?page=1&details=25`.
90
+
91
+
### ❓ My PR is merged into `main`. Is it a penalty?
92
+
93
+
No. As long as the original PR exists and your code is reviewable, there is no automatic penalty for merging.
94
+
However, merging into `main` is **not recommended**, as it may complicate the review process for your mentor.
95
+
57
96
### Cross-check (score can be less if some parts of the functionality don't work)
58
97
59
98
- Custom hook to restore search query from LS - **20**
0 commit comments