Thank you, but the persist library did much more then just saving into the localstorage there was debouncing and much more, now the library is updated and the temporary fix is not used anymore.
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
Indeed you should't get your Hook in a conditionnal way.
Not sure what you wanna do exactly but you can create a custom Hook like that :
You can then use it like a useState.
And you can generalize the name of the storage key as a second parameter of your custom hook in order to reuse you hook anywhere you want.
Thank you, but the persist library did much more then just saving into the localstorage there was debouncing and much more, now the library is updated and the temporary fix is not used anymore.