Last active
February 6, 2020 16:39
-
-
Save jimthedev/99ea173d27db2a97ff739e28c8bbf349 to your computer and use it in GitHub Desktop.
load-latest-react
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
// Make sure you have an html element with an id of root and thewn you can run this. r is react, d is react-dom | |
Promise.all([ | |
import( | |
"https://cdn.jsdelivr.net/npm/@esm-bundle/react-dom/esm/react-dom.resolved.production.min.js" | |
), | |
import( | |
"https://cdn.jsdelivr.net/npm/@esm-bundle/react/esm/react.production.min.js" | |
) | |
]).then(([{ default: d }, { default: r }]) => | |
d.render( | |
r.createElement("div", null, "Hello, React"), | |
document.getElementById("root") | |
) | |
); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment