less than 1 minute read

iframe.contentWindow.postMessage(msg, '*');

When you try to do the above but iframe.contentWindow is null,

you can use useEffect as shown below. This is because you need to access the iframe after rendering is finished.

useEffect(() => {
  setSumerian(document.getElementById('sumerianHost'));
  console.log('ready to start')
}, [])

20211024

Tags:

Categories:

Updated:

Leave a comment