Fix the inserted <div> covering origin content (#151)
When inserting <div> after <body> element, it will create a new <body> to contain the new <div> element. This may cause part of the origin website content to be covered. So just use `beforeend` instead of `afterend` to avoid that.
This commit is contained in:
parent
c2038d36fe
commit
1cd9da3873
|
@ -2,5 +2,5 @@ import React from "react";
|
||||||
import ReactDOM from "react-dom";
|
import ReactDOM from "react-dom";
|
||||||
import TranslateContainer from "./components/TranslateContainer";
|
import TranslateContainer from "./components/TranslateContainer";
|
||||||
|
|
||||||
document.body.insertAdjacentHTML("afterend", "<div id='simple-translate'></div>");
|
document.body.insertAdjacentHTML("beforeend", "<div id='simple-translate'></div>");
|
||||||
ReactDOM.render(<TranslateContainer />, document.getElementById("simple-translate"));
|
ReactDOM.render(<TranslateContainer />, document.getElementById("simple-translate"));
|
||||||
|
|
Loading…
Reference in a new issue