Created
January 6, 2023 19:23
-
-
Save cindywu/68d78d83654f61e01ea1a88a9fb6b068 to your computer and use it in GitHub Desktop.
react components nesting components
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
<!-- index.html --> | |
<html> | |
<body> | |
<div> | |
<div id="app"> | |
</div> | |
<script src="https://unpkg.com/react@17/umd/react.development.js"></script> | |
<script src="https://unpkg.com/react-dom@17/umd/react-dom.development.js"></script> | |
<script src="https://unpkg.com/@babel/standalone/babel.min.js"></script> | |
<script type="text/jsx"> | |
const app = document.getElementById('app') | |
function Header() { | |
return (<h1>Develop. Preview. Ship. 🚀</h1>) | |
} | |
function HomePage() { | |
return ( | |
<div> | |
<Header /> | |
</div> | |
) | |
} | |
ReactDOM.render(<HomePage/>, app) | |
</script> | |
</div> | |
</body> | |
</html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment