title: When page is refreshed data persists in localStorage but, it diappears from the display
body: <p>I am working on a Vanilla JavaScript Library app with local storage. But, when the page is refreshed even though the data persists in localStorage, but it disappears from the display. When clicking the add book button the data is stored on localStorage, and it persists even after the page is refreshed, but the book cards on display, disappear. I can't find out what is wrong with the code.</p>
  <p>Github Address:    <a href="https://github.com/bdarab/online-library" rel="nofollow noreferrer">https://github.com/bdarab/online-library</a></p>
  <pre><code>  static addBookToLibrary() {
      // addBtn.addEventListener(&quot;click&quot;, (e) =&gt; {
      //   e.preventDefault();
        const displayContainer = document.querySelector(&quot;#display&quot;);
        const displayCard = document.createElement(&quot;div&quot;);
        displayCard.classList.add(&quot;card&quot;);
        displayCard.innerHTML += `
          &lt;div class=&quot;card-body&quot;&gt;
            &lt;h5 class=&quot;card-title&quot;&gt;title:&lt;/h5&gt;
            &lt;h5 class=&quot;card-author&quot;&gt;author:&lt;/h5&gt;
            &lt;h5 class=&quot;card-pages&quot;&gt;pages: &lt;/h5&gt;
          &lt;/div&gt;
          &lt;div class=&quot;isRead&quot;&gt;
            &lt;button type=&quot;button&quot; class=&quot;btn btn-secondary&quot; id=&quot;isRead&quot;&gt;
              Is it Read?
            &lt;/button&gt;
            &lt;button type=&quot;button&quot; class=&quot;btn btn-danger&quot; id=&quot;delete&quot;&gt;
              Delete
            &lt;/button&gt;
          &lt;/div&gt;
        `;
        displayContainer.appendChild(displayCard);
    }  // });
  }
  
  // localStorage setup
  /* 3. Store Class */
  
  
  class Store {
    static getBooks() {
      let books;
      if (localStorage.getItem(&quot;books&quot;) === null) {
        books = [];
      } else {
        books = JSON.parse(localStorage.getItem(&quot;books&quot;));
      }
      return books;
    }
  
    static addBook(book) {
      const books = Store.getBooks();
      books.push(book);
      localStorage.setItem(&quot;books&quot;, JSON.stringify(books));
    }
  
    static removeBook(title) {
      const books = Store.getBooks();
      books.forEach((book, index) =&gt; {
        if (book.title === title) {
          books.splice(index, 1);
        }
      });
      localStorage.setItem(&quot;books&quot;, JSON.stringify(books));
    }
  }
  </code></pre>