Closed lariciamota closed 4 months ago
The latest updates on your projects. Learn more about Vercel for Git ↗︎
This pull request is automatically built and testable in CodeSandbox.
To see build info of the built libraries, click here or the icon next to each commit SHA.
What's the purpose of this pull request?
Fix bugs related to the addition of fuzzy parameters to the URL on PLP (category page and search page). See jira tasks on the references section below.
How it works?
By using the
replace
function instead ofpush
we are able to update the URL adding the fuzzy parameters to it without triggering the navigation. Thus, it doesn't re-render the page and it doesn't affect the back button to previous page. It happens because thereplace
doesn't add the new URL as a new entry on thehistory
stack.How to test it?
Test a category page (example:
/office
) and test search also. Both pages should have its URL updated to add the fuzzy and operator params, but shouldn't re-render. Also, if you click the browser return button you should go to the previous page (Home, for example, if you were on the Home page and then went to the category page) normally.Starters Deploy Preview
References
replaceState
replace
function