Discussion on: Conditional hooks, maybe

devdufutur profile image
Rudy Nappée

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.

theonlybeardedbeast profile image
TheOnlyBeardedBeast Author

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.