Created
August 31, 2019 17:43
-
-
Save chriscoyier/10eecc0a35a36778a8d2458907865025 to your computer and use it in GitHub Desktop.
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
const App = () => { | |
useCodePenEmbed(); | |
return ( | |
<PrefillEmbed | |
className="codepen" | |
penTitle="My sweet demo" | |
embedHeight="400" | |
themeId="31205" | |
editable | |
description="Renders a barebones React component" | |
tags={['react', 'react-docs-demo']} | |
htmlClasses={['loading', 'no-js']} | |
head={ | |
<meta name="viewport" content="width=device-width, initial-scale=1" /> | |
} | |
scripts={[ | |
'https://unpkg.com/[email protected]/umd/react.development.js', | |
'https://unpkg.com/[email protected]/umd/react-dom.development.js', | |
]} | |
stylesheets={['https://unpkg.com/[email protected]/normalize.css']} | |
> | |
<PrefillLang lang="html"> | |
{stripIndent` | |
<div id="root"></div> | |
`} | |
</PrefillLang> | |
<PrefillLang lang="scss"> | |
{stripIndent` | |
$bg: #eee; | |
body { | |
background: $bg; | |
} | |
`} | |
</PrefillLang> | |
<PrefillLang lang="babel"> | |
{stripIndent` | |
const App = () => <h1>Hello</h1>; | |
ReactDOM.render( | |
<App/>, | |
document.getElementById('root') | |
); | |
`} | |
</PrefillLang> | |
</PrefillEmbed> | |
); | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment