Created
June 21, 2018 16:00
-
-
Save codeOfRobin/93e89c926ef449debf5f48874a24e5af to your computer and use it in GitHub Desktop.
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
<div id="root"></div> | |
<script crossorigin src="https://unpkg.com/react@16/umd/react.development.js"></script> | |
<script crossorigin src="https://unpkg.com/react-dom@16/umd/react-dom.development.js"></script> | |
<script src="https://unpkg.com/babel-standalone@6/babel.min.js"></script> | |
<script src="https://unpkg.com/prop-types@15.6/prop-types.min.js"></script> | |
<script type="text/babel"> | |
let rootElement = document.getElementById("root") | |
function SayHello(props) { | |
return ( | |
<div> | |
Hello {props.firstName} {props.secondName}! | |
</div> | |
) | |
} | |
SayHello.propTypes = { | |
firstName: PropTypes.string.isRequired, | |
secondName: PropTypes.string.isRequired | |
} | |
let element = <SayHello firstName={true} secondName={"something"}/> | |
ReactDOM.render(element, rootElement) | |
</script> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment