1.0.0 • Published 5 years ago

sebact v1.0.0

Weekly downloads
3
License
ISC
Repository
github
Last release
5 years ago

:100: sebact

My own React (heavily inspired by Didact)

Elements

Describes what needs to be rendered and have two required properties: type and props

const myElement = {
  type: 'div',
  props: {
    id: 'container',
    children: [
      { type: 'input', props: { value: 'foo', type: 'text' } },
      { type: 'a', props: { href: '/bar' } },
      { type: 'span', props: {} }
    ]
  }
};

Which is translated to the DOM in the following way:

<div id="container">
  <input value="foo" type="text" />
  <a href="/bar" />
  <span></span>
</div>