by ipsum2 · 6y ago · 0 comments
function useStickyState(defaultValue, key)
should be function useStickyState(key, defaultValue)And even if it is a trivial solution, it brings up an interesting idea. Why this article and not the others? Because it was posted at the right time. I'm sure if another one of those articles was posted here (and was written in an equally approachable way) it would do just as well.
LE: I actually tested the site with Cookies disabled and the entire site crashed due to the localStorage calls.
useStickyState("count", 0);
Then later in the article:
useStickyState('day', 'calendar-view');
Thanks for the heads-up.