Skip to content

Instantly share code, notes, and snippets.

@CezaryDanielNowak
Created March 28, 2019 11:47
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save CezaryDanielNowak/dbc10619bc87f39cf2a29ec097351580 to your computer and use it in GitHub Desktop.
Save CezaryDanielNowak/dbc10619bc87f39cf2a29ec097351580 to your computer and use it in GitHub Desktop.
<html lang="en">
<head>
<meta charset="UTF-8"/>
<meta name="viewport" content="width=device-width, initial-scale=1.0"/>
<meta http-equiv="X-UA-Compatible" content="ie=edge"/>
<title>react-fns with script tags</title>
<!-- Load React -->
<script src="https://unpkg.com/react/umd/react.development.js"></script>
<script src="https://unpkg.com/react-dom/umd/react-dom.development.js"></script>
<!-- Load babel for JSX -->
<script src="https://unpkg.com/babel-standalone@6.26.0/babel.js"></script>
<script src="https://unpkg.com/react-fns@1.3.0/dist/index.umd.js"></script>
<!-- Technically there is a minified production build too. -->
<!-- <script src="https://unpkg.com/react-fns@1.3.0/dist/index.umd.min.js"></script> -->
</head>
<body>
<div id="root"></div>
<script type="text/babel">
const DeviceMotion = window.ReactFns.DeviceMotion
const App = () => {
return (
<DeviceMotion
render={deviceMotionHelpers => (
<pre>{JSON.stringify(deviceMotionHelpers, null, 2)}</pre>
)}
/>
);
};
ReactDOM.render(<App />, document.getElementById('root'));
</script>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment