47ng / nuqs

Type-safe search params state manager for React frameworks - Like useState, but stored in the URL query string.
https://nuqs.47ng.com
MIT License
4.86k stars 104 forks source link

Making user History Garbage #721

Closed MobinX closed 3 weeks ago

MobinX commented 3 weeks ago

Context

What's your version of nuqs?

-> Paste result from `cat package.json | grep -e nuqs` here

What framework are you using?

Which version of your framework are you using?

-> Paste the relevant framework versions from your package.json here

Description

Reproduction

MobinX commented 3 weeks ago

Hey, it is good but it making user history log a long really really as every state update create a new history entry, so it is making garbage in user device.sucks

franky47 commented 3 weeks ago

The default is to replace the current entry in the history stack (history: 'replace'), this behaviour is opt-in when using history: 'push'.

Pushing new history entries isn't for every kind of state, since it also hijacks the Back button. Use it responsibly.