0.0.4 • Published 5 years ago

@hyperhooks/hyperhooks v0.0.4

Weekly downloads
-
License
MIT
Repository
github
Last release
5 years ago

HyperHooks

A new experimental approach to Hyperscript and hooks

Quick start

require('hyperhooks/hyper.js') // hyperscript and hooks
require('hyperhooks/dom.js') // render to html

// Define our app
let App = () => {
  const [count, setCount] = useState(0)

  return h('div', undefined,
    `Total  🍌🍌🍌: ${count}`,
     h('button', { onPress: () => { setCount(count + 1) }, label: `Add one 🍌!` }),
  )
}

// Render our app to the body
render(h(App), document.body)

Documentation

Head over to the main site for a more detailed introduction plus documentation.