Skip to content

Commit

Permalink
Example barebones react app, static, w/ JSX
Browse files Browse the repository at this point in the history
  • Loading branch information
locofocos committed May 3, 2022
1 parent 598f993 commit 3e3fe18
Show file tree
Hide file tree
Showing 2 changed files with 37 additions and 0 deletions.
21 changes: 21 additions & 0 deletions app.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
'use strict'

const App = () => {
return <div>
<ExampleComponent title="example component title"/>
<p>It's working</p>
</div>
}

class ExampleComponent extends React.Component {
constructor (props) {
super()
}

render () {
return <h1>{this.props.title}</h1>
}
}

const root = ReactDOM.createRoot(document.getElementById('app'))
root.render(<App/>)
16 changes: 16 additions & 0 deletions index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
<html>
<head>
<!-- Note: when deploying, replace "development.js" with "production.min.js". -->
<script src="https://unpkg.com/react@18/umd/react.development.js" crossorigin></script>
<script src="https://unpkg.com/react-dom@18/umd/react-dom.development.js" crossorigin></script>
<script src="https://unpkg.com/babel-standalone@6/babel.min.js"></script>
<script src="app.js" type="text/babel"></script>
</head>
<body>

<div id="app">
<p>Loading...</p>
</div>

</body>
</html>

0 comments on commit 3e3fe18

Please sign in to comment.