A
A
Andrey Okhotnikov2020-01-15 11:28:43
React
Andrey Okhotnikov, 2020-01-15 11:28:43

Router not updating url?

nextjs. If I am on the /catalog/items page and using router.push or via Link I follow the link /product/123?color=1 - everything works correctly, but if I go from the /product/123?color=1 page to /product /666?color=2, then only the color parameter changes, and 123 does not change to 666.
I tried Link, push, replace - it does not help.
How to fix it?

Router.push('/product?article=666', '/product/666')

Answer the question

In order to leave comments, you need to log in

1 answer(s)
I
IDONTSUDO, 2020-01-15
@IDONTSUDO

everything after the = sign is query params here is an example from the documentation
https://reacttraining.com/react-router/web/example...

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question