Last active
March 13, 2019 15:17
-
-
Save appwebtech/4da96ea2203896ab27b6b32b084e04fb to your computer and use it in GitHub Desktop.
// source https://jsbin.com
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
<script src="https://fb.me/react-with-addons-15.1.0.js"></script> | |
<script src="https://fb.me/react-dom-15.1.0.js"></script> | |
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta charset="utf-8"> | |
<meta name="viewport" content="width=device-width"> | |
<title>JS Bin</title> | |
</head> | |
<body> | |
<script id="jsbin-javascript"> | |
const MyApp = ((props) => { | |
const element = ( | |
React.createElement("div", null, | |
React.createElement("h1", null, "Hey Virtual DOM?"), | |
React.createElement("h3", null, "Ive been rendered ", props, " times!") | |
) | |
) | |
ReactDOM.render( | |
element, | |
document.getElementById('app') | |
) | |
}); | |
var numTimes = 0 | |
setInterval(() => { | |
numTimes += 1 | |
MyApp(numTimes) | |
}, 1000) | |
</script> | |
// Under chrome dev tools, make sure "Paint Flashing" is selected under rendering for the BG color to flash. | |
<script id="jsbin-source-javascript" type="text/javascript">const MyApp = ((props) => { | |
const element = ( | |
<div> | |
<h1>Hey Virtual DOM?</h1> | |
<h3>Ive been rendered {props} times!</h3> | |
</div> | |
) | |
ReactDOM.render( | |
element, | |
document.getElementById('app') | |
) | |
}); | |
var numTimes = 0 | |
setInterval(() => { | |
numTimes += 1 | |
MyApp(numTimes) | |
}, 1000)</script></body> | |
</html> |
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
const MyApp = ((props) => { | |
const element = ( | |
React.createElement("div", null, | |
React.createElement("h1", null, "Hey Virtual DOM?"), | |
React.createElement("h3", null, "Ive been rendered ", props, " times!") | |
) | |
) | |
ReactDOM.render( | |
element, | |
document.getElementById('app') | |
) | |
}); | |
var numTimes = 0 | |
setInterval(() => { | |
numTimes += 1 | |
MyApp(numTimes) | |
}, 1000) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment