# babel-plugin-transform-fn-jsx

> Transforms JSX into js function calls

Latest version **0.2.0** (published 2019-10-17) · MIT license · 0 weekly downloads

## Install

```sh
npm install babel-plugin-transform-fn-jsx
pnpm add babel-plugin-transform-fn-jsx
yarn add babel-plugin-transform-fn-jsx
bun add babel-plugin-transform-fn-jsx
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.2.0 |
| Published | 2019-10-17 |
| First published | 2019-10-16 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 1 |
| Unpacked size | 4.8 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | 4erem6a |
| Maintainers | 4erem6a |

## Links

- npm: https://www.npmjs.com/package/babel-plugin-transform-fn-jsx
- npm.io page: https://npm.io/package/babel-plugin-transform-fn-jsx

## Dependencies (1)

- [@babel/plugin-syntax-jsx](https://npm.io/package/@babel/plugin-syntax-jsx.md) ^7.2.0

## Recent versions

- 0.2.0 (latest) — 2019-10-17
- 0.1.2 — 2019-10-16
- 0.1.1 — 2019-10-16
- 0.1.0 — 2019-10-16

## README

# babel-plugin-transform-fn-jsx

[![npm version](https://badge.fury.io/js/babel-plugin-transform-fn-jsx.svg)](https://www.npmjs.com/package/babel-plugin-transform-fn-jsx)

Transforms JSX into js function calls.

## Examples

### Elements

```jsx
<text>2 + 2 = {2 + 2}</text>
```

is

```js
text({}, ["2 + 2 = ", 2 + 2]);
```

### Namespaces

```jsx
<ns:element>
  <ns:another />
</ns:element>
```

is

```js
ns(element, {}, [ns(another, {}, [])]);
```

### Fragments

```jsx
<>
  <element />
  <element />
  <element />
</>
```

is

```js
[element({}, []), element({}, []), element({}, [])];
```

## Options

`removeEmptyText: boolean` (default: true)  
Removes blank and empty JSXText elements.

Example:

```jsx
// JSX
(
  <>
    <element />
    <element />
    <element />
  </>
)[
  // Compiled JS
  // removeEmptyText: true
  (element({}, []), element({}, []), element({}, []))
][
  // removeEmptyText: false
  ("\n\t",
  element({}, []),
  "\n\t",
  element({}, []),
  "\n\t",
  element({}, []),
  "\n")
];
```

---
_Source: https://npm.io/package/babel-plugin-transform-fn-jsx · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
