Last active
February 9, 2019 11:00
-
-
Save jeswin/c7df31f02344be2c84870fa5136382cf to your computer and use it in GitHub Desktop.
router-article-startup
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
if (document.readyState === "loading") { | |
// Loading hasn't finished yet | |
document.addEventListener("DOMContentLoaded", startup); | |
} else { | |
// `DOMContentLoaded` has already fired | |
startup(); | |
} | |
function startup() { | |
ReactDOM.render( | |
<Home | |
todos={todos} | |
pathArr={window.location.pathname.split("/").slice(1)} | |
/>, | |
document.getElementById("container") | |
); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment