martinkr / next-export-i18n

Internationalize (18n) next.js with true support for next export
MIT License
247 stars 37 forks source link

update useLanguageQuery for dynamic routes #60

Closed renatoruk closed 11 months ago

renatoruk commented 1 year ago

This PR fixes handling query params for useLanguageQuery using dynamic routes.

Take this case for example. We have two pages, index.js and [id].js.

The user first lands on / page and wants to go to /foo. The passedQuery would not be updated because it's not tracked inside dependencies array.

The tests were needed to be updated because query needs to be passed as reference to not be treated as a change.

martinkr commented 11 months ago

Thank you for your contribution!