title: How to update swiper.js if state changes in React.js?
body: <p>I have a state “isOpen=false” and I need to update or reinitialize swiper.js when state changes to true. How is it possible to do?</p>
  
  <pre><code>@observable 
  public isOpen=false
  
  private DOMTopSwiper = createRef&lt;HTMLDivElement&gt;()
  
  const topSwiper = new Swiper(this.DOMTopSwiper.current, {
    spaceBetween: 0,
    navigation: {
      nextEl: ".top-swiper-button-next",
      prevEl: ".top-swiper-button-prev",
    },
  })
  </code></pre>