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:
Ne1s07 2019-05-02 11:54:38 +08:00 committed by sienori
parent c2038d36fe
commit 1cd9da3873

View file

@ -2,5 +2,5 @@ import React from "react";
import ReactDOM from "react-dom";
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"));