🚀 DAY 5 OF LAUNCH WEEK:Introducing Webhook Events for Alert Changes.Learn more →
Socket
Book a DemoInstallSign in
Socket

@intrnl/babel-plugin-transform-jsx-to-string

Package Overview
Dependencies
Maintainers
1
Versions
8
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@intrnl/babel-plugin-transform-jsx-to-string

Babel plugin for transforming JSX to HTML string equivalent

latest
Source
npmnpm
Version
0.2.5
Version published
Maintainers
1
Created
Source

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>');
}

FAQs

Package last updated on 19 Mar 2022

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts