samedi 26 septembre 2020

Query params changing the history and bugging the back behavior

My applicant persists a lot of filters on the URL query params. The problem that I'm struggling with is that every query param added to the URL creates a new history.

So if I try to go back from that URL with history.goBack:

http://localhost:4001/applicants?jobId=1&orderBy=applied_at&page=1&status=%5B%22AWAITING_REVIEW%22%2C%22CLAIMED%22%2C%22CONTACTED_LEFT_MESSAGE%22%2C%22INTERVIEW_SCHEDULED%22%2C%22OFFER_MADE%22%5D

Instead of going to the previous page, I'll go to:

http://localhost:4001/applicants?jobId=1&orderBy=applied_at&page=1

Gif showing the behavior:

enter image description here

I know that there must be a lot of applications that persist values via query params and I would like to understand how to deal with the history.goBack when having query params on the URL.




Aucun commentaire:

Enregistrer un commentaire