Skip to content

Instantly share code, notes, and snippets.

@bgoonz
Created May 28, 2022 23:55
Show Gist options
  • Save bgoonz/8757a56839f7ddd8ec1b834c22333f0d to your computer and use it in GitHub Desktop.
Save bgoonz/8757a56839f7ddd8ec1b834c22333f0d to your computer and use it in GitHub Desktop.
Example: Fragments
<script src="https://unpkg.com/@babel/standalone/babel.js"></script>
<script src="https://unpkg.com/react/umd/react.development.js"></script>
<script src="https://unpkg.com/react-dom/umd/react-dom.development.js"></script>
<div id="root"/>
<script type="text/babel">
function Example() {
return (
<>
Some text.
<h2>A heading</h2>
More text.
<h2>Another heading</h2>
Even more text.
</>
);
}
ReactDOM.render(<Example />, document.getElementById('root'));
</script>
#modal-container {
position: relative;
z-index: 999;
}
.app {
height: 10em;
width: 10em;
background: lightblue;
overflow: hidden;
}
.modal {
background-color: rgba(0,0,0,0.5);
position: fixed;
height: 100%;
width: 100%;
top: 0;
left: 0;
display: flex;
align-items: center;
justify-content: center;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment