0.2.5 • Published 3 years ago

@intrnl/babel-plugin-transform-jsx-to-string v0.2.5

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

babel-plugin-transform-jsx-to-string

Transforms JSX into HTML string equivalent

function App () {
  return (
    <>
      <div>Hello world!</div>
      <Counter count={0} />
    </>
  );
}

function Counter ({ count }) {
  return (
    <x-counter>
      <div>count: <span x-target='x-counter.display'>{count}</span></div>
      <button x-action='click:x-counter#increment'>+</button>
      <button x-action='click:x-counter#decrement'>-</button>
    </x-counter>
  );
}
import { html as $html, text as $text } from '@intrnl/babel-plugin-transform-jsx-to-string/runtime';

function App() {
  return $html('<div>Hello world!</div>' + $text(Counter({ count: 0 })) + '');
}

function Counter({ count }) {
  return $html('<x-counter><div>count: <span x-target="x-counter.display">' + $text(count) + '</span></div><button x-action="click:x-counter#increment">+</button><button x-action="click:x-counter#decrement">-</button></x-counter>');
}
0.2.5

3 years ago

0.2.4

3 years ago

0.2.3

3 years ago

0.2.2

3 years ago

0.2.1

3 years ago

0.2.0

3 years ago

0.1.1

3 years ago

0.1.0

3 years ago