JSFiddle - React, Tailwind, and code Playground

by Yukino Song

Babel + JSX

const React = ef
const {t, registerProps} = ef

const MyHello = t`
>h1
  .HelloWorld!
  >p
    .{{some.very.deep.path}}
+children
`

registerProps(MyHello, {
  short: {
    key: 'path',
    root: state => state.$data.some.very.deep
  }
})

const aaa = <h1>Created from JSX!</h1>
  
const bbb = <MyHello>
    {aaa}
    Also supports JSX fragments!
    <p>Have fun!</p>
    <button>123</button>
</MyHello>
      
const ddd = new ef.Fragment('12345', <h2>aaa</h2>)
      
const ccc = <><div>{bbb}<br/>lolol</div>uiuuiuuiuiui{ddd}</>
  
ccc.$mount({target: document.body})

console.trace(bbb)
bbb.abc = 123