Adapters to make nanocomponent run natively inside frameworks. This allows you to write highly performant components once, and reuse them between all frameworks.
Table of Contents
Not all languages and frameworks are supported yet; PRs to support more frameworks support are very welcome!
- React / Preact
- Choo
- Angular
- Ember
- Cycle
- Vue
- Inferno
- Custom Elements (webcomponents)
- Elm
React / Preact
var toReact = var Nanocomponent = var reactDom = var react = var html = { super thiscolor = null } { console } { thiscolor = color return html` Click Me ` } { return color !== thiscolor } var ReactButton = reactDom
It's very similar with Preact, or any other React-like library that exposes a
Component
base class and a createElement
function:
var preact = var PreactButton = preact
Choo
Choo just works™.
var Nanocomponent = var html = var choo = // create new nanocomponent { super thiscolor = null } { console } { thiscolor = color return html` Click Me ` } { return color !== thiscolor } var app = appapp var customButton = { return html` `}