DEV Community

artydev
artydev

Posted on

A note about Mithril

Mithril is a very nice framework. It's the first one I have been professionaly productive with.

Many, people don't like it's syntax.
If you prefer JSX, no problem, you can too.

Look at this demo JSX in Mithril:

/* @jsx m  */

let counter = 0;

function App () {
  const view = 
    <div>
      <div>Counter: {counter}</div>
      <button onclick={() => ++counter}>JSX-INC</button>   
      { m("button", {onclick : () => ++counter}, "m-CLICK") } //mithrilway
    </div>
  return view
}

m.mount(document.body, { view : App });

Enter fullscreen mode Exit fullscreen mode

Heroku

Build apps, not infrastructure.

Dealing with servers, hardware, and infrastructure can take up your valuable time. Discover the benefits of Heroku, the PaaS of choice for developers since 2007.

Visit Site

Top comments (0)

Sentry image

See why 4M developers consider Sentry, “not bad.”

Fixing code doesn’t have to be the worst part of your day. Learn how Sentry can help.

Learn more