coreui / coreui-free-react-admin-template

Open source admin template based on Bootstrap 5 and React.js
https://coreui.io/product/free-react-admin-template/
MIT License
4.6k stars 2.33k forks source link

Iframe appear after auto reload browser. #344

Closed kiditran closed 2 years ago

kiditran commented 2 years ago

My information:

Hi CoreUI React Team,

Today, I pull v4.1.1 from Github to my PC. Everything works fine but I don't understand that each time I change code, an iframe appears when the browser automatically loading. It contains all Coreui document tags that are really weird.

So you can see this screenshot and support me soon image

Thank you so much. Kidi.

sankalpmukim commented 2 years ago

I was facing this issue as well... I used this to fix it. Put this useEffect in preferably a very high component, something like an <App/> component or a wrapper specifically for it. Because, theoretically, everything React has access to shouldn't be outside of the div#root element.

useEffect(() => {
  // select the iframe element
  var iframe = document.querySelector("body > iframe");
  if (!!iframe) {
    // delete the iframe element
    iframe.parentNode.removeChild(iframe);
    // log success
    console.log("iframe removed");
  }
}, []);

I don't know why it worked lol. If this doesn't work, do try removing the [] as the second parameter. If you found what was causing this, lemme know please.

github-actions[bot] commented 2 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions

Transtar2 commented 2 years ago

i Have same problem

thisiskhandev commented 2 years ago

Same getting issues