# @vue/babel-sugar-composition-api-inject-h

> Babel syntactic sugar for h automatic injection for Vue JSX with @vue/composition-api

Latest version **1.4.0** (published 2022-08-25) · MIT license · 0 weekly downloads

## Install

```sh
npm install @vue/babel-sugar-composition-api-inject-h
pnpm add @vue/babel-sugar-composition-api-inject-h
yarn add @vue/babel-sugar-composition-api-inject-h
bun add @vue/babel-sugar-composition-api-inject-h
```

## Health

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

Positive: no vulnerabilities.

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

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.4.0 |
| Published | 2022-08-25 |
| First published | 2020-10-16 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 1 |
| Unpacked size | 3.5 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 1476 |
| Author | luwanquan |
| Maintainers | akryum, yyx990803, soda, amour1688 |

## Links

- npm: https://www.npmjs.com/package/@vue/babel-sugar-composition-api-inject-h
- Repository: https://github.com/vuejs/jsx.git#master
- Homepage: https://github.com/vuejs/jsx/tree/master#readme
- Issues: https://github.com/vuejs/jsx/issues
- npm.io page: https://npm.io/package/@vue/babel-sugar-composition-api-inject-h

## Dependencies (1)

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

## Recent versions

- 1.4.0 (latest) — 2022-08-25
- 1.3.0 — 2022-07-06
- 1.2.1 — 2020-10-16
- 1.2.0 — 2020-10-16

## README

## @vue/babel-sugar-composition-api-inject-h

> Ported from [luwanquan/babel-preset-vca-jsx](https://github.com/luwanquan/babel-preset-vca-jsx) by [@luwanquan](https://github.com/luwanquan)

Syntactic sugar for automatic `h` inject in JSX with @vue/composition-api.

### Babel Compatibility Notes

- This repo is only compatible with Babel 7.x

### Usage

Install the dependencies:

```sh
# for yarn:
yarn add @vue/babel-sugar-composition-api-inject-h
# for npm:
npm install @vue/babel-sugar-composition-api-inject-h --save
```

In your `.babelrc`:

```json
{
  "plugins": ["@vue/babel-sugar-composition-api-inject-h"]
}
```

However it is recommended to use the [configurable preset](../babel-preset-jsx/README.md) instead.

### Details

This plugin automatically injects `h` in every method that has JSX. By using this plugin you don't have to always import `h` from `@vue/composition-api`.

```js
// Without @vue/babel-sugar-inject-h
import { h } from '@vue/composition-api'

export default {
  setup() {
    return () => <button />
  },
}
```

```js
// With @vue/babel-sugar-inject-h
export default {
  setup() {
    return () => <button />
  },
}
```

---
_Source: https://npm.io/package/@vue/babel-sugar-composition-api-inject-h · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
