Anujcodecraft / Anujcodecraft/notes-online

## 🐞 Issue: Pagination Resets to First Page on Refresh

Aperta
#28 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub
bug enhancement good first issue ReactJs UI
Lingua principale
JavaScript
Stelle
7
Fork
7
Metriche di merge delle PR
Nessuna PR unita negli ultimi 30g

Descrizione

### Description

When a user navigates to **Browse Notes** or **Browse PYQ**, changes to **page 2** (or any other page), and then **refreshes the browser**, the page resets to **page 1** instead of staying on the selected page.

This breaks the expected behavior of persistent pagination and impacts user experience, especially when browsing large datasets.

---

### ✅ Expected Behavior

- After refreshing the page, the user should remain on the **same page number** they were on before the refresh (e.g., page 2).
- Pagination state should persist through browser refreshes or deep links.

---

### 🧪 Steps to Reproduce

1. Go to **Browse Notes** or **Browse PYQ** of [🌐 Live Demo](https://manitstudyportal.netlify.app/).
2. Click to navigate to **Page 2**.
3. Refresh the browser.
4. Observe: The user is redirected back to **Page 1**.

---

### 💡 Proposed Solution

- Use **URL query parameters** to store the current page number (e.g., `?page=2`).
- On component mount, read the `page` query param from the URL and set it as the current page state.
- Update the query param whenever the user navigates to a new page.

Guida per i contributori

Nessuna guida per i contributori indicizzata per questo repository

Valutazione

Questa issue non è ancora stata valutata.

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.