Last active
November 7, 2019 15:13
-
-
Save prozacgod/e1aad87eb8aa835ff257081cad7f9d88 to your computer and use it in GitHub Desktop.
Testing react bug with dev libraries not working in tampermonkey environment.
This file contains hidden or 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
// ==UserScript== | |
// @name Test react bug with dev module | |
// @version 0.1 | |
// @description React Development | |
// @author Prozacgod | |
// @match http://localhost:8080/ | |
// @grant unsafeWindow | |
// @grant GM_registerMenuCommand | |
// @grant GM_xmlhttpRequest | |
// Works with these | |
// @require https://cdnjs.cloudflare.com/ajax/libs/react/16.4.2/umd/react.development.js | |
// @require https://cdnjs.cloudflare.com/ajax/libs/react-dom/16.4.2/umd/react-dom.development.js | |
// // @require https://cdnjs.cloudflare.com/ajax/libs/react/16.10.2/umd/react.production.min.js | |
// // @require https://cdnjs.cloudflare.com/ajax/libs/react-dom/16.10.2/umd/react-dom.production.min.js | |
// Crashes/Infinite loops in different ways with 16.5.2 and onward (development versions) | |
// // @require https://cdnjs.cloudflare.com/ajax/libs/react/16.10.2/umd/react.development.js | |
// // @require https://cdnjs.cloudflare.com/ajax/libs/react-dom/16.10.2/umd/react-dom.development.js | |
// ==/UserScript== | |
(function() { | |
'use strict'; | |
let elem = document.getElementById('testing-element'); | |
if (!elem) { | |
elem = document.createElement('div'); | |
elem.id = 'testing-element'; | |
document.body.appendChild(elem); | |
} | |
ReactDOM.render(React.createElement('div', {}, ["Foo!"]), elem); | |
})(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment