title: How to use document and window element in react.js
body: <p>I am trying to render a npm package plugin "react-share" inside an existing next.js / react.js app. However the plugin makes use of elements rendered on the client:</p>
  
  <pre><code>ReactDOM.render(&lt;ShareButtons /&gt;, document.querySelector('#content')); 
  </code></pre>
  
  <p>and window in:</p>
  
  <pre><code>  &lt;PinterestShareButton
      url={String(window.location)}
      media={`${String(window.location)}/${exampleImage}`}
      windowWidth={1000}
      windowHeight={730}
      className="Demo__some-network__share-button"&gt;
      &lt;PinterestIcon size={32} round /&gt;
    &lt;/PinterestShareButton&gt;
  </code></pre>
  
  <p>I can find any simple workarounds to this, have I missed something?</p>
  
  <p>Lilian</p>