title: How can I wait for the value from localStorage?
body: <p>I am trying to get values that i save in localStorage but the components render faster and the values are stored later. So for the first time it comes undefined. How can I wait for the values to be stored and than render ?</p>
  
  <p>HERE I GET THE VALUE AFTER IS STORED</p>
  
  <p>The first time comes null because needs time to be stored.</p>
  
  <pre><code>function getUsername() {
      const userData = store.get('user');
      const userFullName = userData &amp;&amp; JSON.stringify(userData.fullName)
          ? JSON.stringify(userData.fullName).replace(/"([^"]+(?="))"/g, '$1')
          : null
      console.log(userFullName);
      return userFullName;
  };
  </code></pre>
  
  <p>HERE I RENDER </p>
  
  <pre><code>&lt;AccountFound fullName={getUsername()}/&gt;
  </code></pre>