Skip to content

Instantly share code, notes, and snippets.

@oskarhane
Last active April 18, 2017 10:02
Show Gist options
  • Save oskarhane/7e1fb23c1b9d0dc43f1d6b9069ed5190 to your computer and use it in GitHub Desktop.
Save oskarhane/7e1fb23c1b9d0dc43f1d6b9069ed5190 to your computer and use it in GitHub Desktop.
esnextbin sketch
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>ESNextbin Sketch</title>
<!-- put additional styles and scripts here -->
</head>
<body>
<div id="app"></div>
</body>
</html>
import { h, render } from 'preact'
/** @jsx h */
const Comp = ({children}) => {
console.log(children)
return children
}
const val = 'xx'
render(<Comp>{val}Hello</Comp>, document.getElementById('app'))
{
"name": "esnextbin-sketch",
"version": "0.0.0",
"dependencies": {
"preact": "8.1.0"
}
}
'use strict';
var _preact = require('preact');
/** @jsx h */
var Comp = function Comp(_ref) {
var children = _ref.children;
console.log(children);
return children;
};
var val = 'xx';
(0, _preact.render)((0, _preact.h)(
Comp,
null,
val,
'Hello'
), document.getElementById('app'));
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment