Next.js Discord

Discord Forum

router.push with url params slow

Answered
Nile Crocodile posted this in #help-forum
Open in Discord
Nile CrocodileOP
pretty much what it says, when i try to add url params to the page i am on rn its slow to do so

13 Replies

@Nile Crocodile pretty much what it says, when i try to add url params to the page i am on rn its slow to do so
router.push() with make a new request to the url. do you want that or you just want to add params to url?
Nile CrocodileOP
just doing filter on a list. so when i update the url params i want to rerun my react query with those params
Answer
Nile CrocodileOP
window.history.pushState does seem to work
its more performant
@Nile Crocodile window.history.pushState does seem to work
yes because it is just changing the url
Nile CrocodileOP
yeah
push redirects
thanks for the help
np
Nile CrocodileOP
how do i mark this as answered
right click the message > application > mark solution
Nile CrocodileOP
got it