Since any meaningful behavior hinges on the availability of the window object, this hook doesn't work well in testing environments. We should be able to gracefully degrade to work exactly like setState if window or the localStorage API isn't available.