made with esnextbin
Last active
April 18, 2017 10:02
-
-
Save oskarhane/7e1fb23c1b9d0dc43f1d6b9069ed5190 to your computer and use it in GitHub Desktop.
esnextbin sketch
This file contains 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
<!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> |
This file contains 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
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')) |
This file contains 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
{ | |
"name": "esnextbin-sketch", | |
"version": "0.0.0", | |
"dependencies": { | |
"preact": "8.1.0" | |
} | |
} |
This file contains 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
'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