title: cast retrieved object from localstorage with TS
body: <p><code>const [history, setHistory] = useState(localStorage.getItem('history') || {});</code></p>
  <p>TS doesn't know what's the history type anymore once I've saved it in the localstorage and retrieve it back, how do I reassign the type back? so that I can use it like</p>
  <p><code>JSON.parse(history).id</code></p>