Last active
February 7, 2018 16:02
-
-
Save lricoy/a9cfcc64f4053d198425c73782f01452 to your computer and use it in GitHub Desktop.
React createElement without JSX
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
<!DOCTYPE html> | |
<html> | |
<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> | |
<body> | |
<div id="myApp"></div> | |
<script type="text/javascript"> | |
const rootElement = document.getElementById('myApp') | |
const message = React.createElement( | |
'span', | |
{ className: 'stylish-message' }, | |
'React sem JSX' | |
) | |
ReactDOM.render(message, rootElement) | |
</script> | |
</body> | |
</html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment