Skip to content

Instantly share code, notes, and snippets.

@oskarhane
Last active April 18, 2017 10:03
Show Gist options
  • Save oskarhane/e9b1d7c4da061b144c67d93291824d96 to your computer and use it in GitHub Desktop.
Save oskarhane/e9b1d7c4da061b144c67d93291824d96 to your computer and use it in GitHub Desktop.

Revisions

  1. oskarhane revised this gist Apr 18, 2017. 2 changed files with 2 additions and 2 deletions.
    2 changes: 1 addition & 1 deletion esnextbin.md
    Original file line number Diff line number Diff line change
    @@ -1 +1 @@
    made with [esnextbin](http://esnextb.in)
    made with [esnextbin](http://esnextb.in/?gist=e9b1d7c4da061b144c67d93291824d96)
    2 changes: 1 addition & 1 deletion package.json
    Original file line number Diff line number Diff line change
    @@ -2,6 +2,6 @@
    "name": "esnextbin-sketch",
    "version": "0.0.0",
    "dependencies": {
    "preact": "8.1.0"
    "preact": "7.2.1"
    }
    }
  2. oskarhane created this gist Apr 18, 2017.
    1 change: 1 addition & 0 deletions esnextbin.md
    Original file line number Diff line number Diff line change
    @@ -0,0 +1 @@
    made with [esnextbin](http://esnextb.in)
    11 changes: 11 additions & 0 deletions index.html
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,11 @@
    <!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>
    11 changes: 11 additions & 0 deletions index.js
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,11 @@
    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'))
    7 changes: 7 additions & 0 deletions package.json
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,7 @@
    {
    "name": "esnextbin-sketch",
    "version": "0.0.0",
    "dependencies": {
    "preact": "8.1.0"
    }
    }
    21 changes: 21 additions & 0 deletions transpiled.js
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,21 @@
    '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'));