Heads up to the author, the code example is wrong.
function useStickyState(defaultValue, key)
should be function useStickyState(key, defaultValue)