block by ramnathv b7d713d8f22d185de3b03201263d41d7

esnextbin sketch

Full Screen

index.js

// write ES2015 code and import modules from npm
// and then press "Execute" to run your program
/** @jsx m */

import m from 'mithril'
import {mount as render} from 'mithril'



const App = {
  view(ctrl, props){
    return <h2>{props.name}</h2>
  }
}
  
  
render(
  document.getElementById("app"),
  <App name="Hello" />,
)

index.html

<!doctype html>
<html>
<head>
  <meta charset="utf-8">
  <title>ESNextbin Sketch</title>
  <!-- put additional styles and scripts here -->
</head>
<body>
  <!-- put markup and other contents here -->
  <div id="app"></div>
</body>
</html>

esnextbin.md

made with [esnextbin](http://esnextb.in)

package.json

{
  "name": "esnextbin-sketch",
  "version": "0.0.0",
  "dependencies": {
    "mithril": "0.2.3"
  }
}

transpiled.js

'use strict';

var _mithril = require('mithril');

var _mithril2 = _interopRequireDefault(_mithril);

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

// write ES2015 code and import modules from npm
// and then press "Execute" to run your program
/** @jsx m */

var App = {
  view: function view(ctrl, props) {
    return (0, _mithril2.default)(
      'h2',
      null,
      props.name
    );
  }
};

(0, _mithril.mount)(document.getElementById("app"), (0, _mithril2.default)(App, { name: 'Hello' }));