# @kdujs/babel-sugar-inject-h

> Babel syntactic sugar for h automatic injection for Kdu JSX

Latest version **1.4.0** (published 2023-07-29) · MIT license · 0 weekly downloads

## Install

```sh
npm install @kdujs/babel-sugar-inject-h
pnpm add @kdujs/babel-sugar-inject-h
yarn add @kdujs/babel-sugar-inject-h
bun add @kdujs/babel-sugar-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 | 2023-07-29 |
| First published | 2022-07-24 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 1 |
| Unpacked size | 2.8 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | NKDuy |
| Maintainers | nkduy |

## Links

- npm: https://www.npmjs.com/package/@kdujs/babel-sugar-inject-h
- Repository: https://github.com/kdujs/jsx.git#main
- Homepage: https://github.com/kdujs/jsx/tree/main#readme
- Issues: https://github.com/kdujs/jsx/issues
- npm.io page: https://npm.io/package/@kdujs/babel-sugar-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) — 2023-07-29
- 1.2.4 — 2022-12-30
- 1.1.3 — 2022-12-17
- 1.0.1 — 2022-12-15
- 1.1.2 — 2022-07-24

## README

## @kdujs/babel-sugar-inject-h

Syntactic sugar for automatic `h` inject in JSX.

### Usage

Install the dependencies:

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

In your `.babelrc`:

```json
{
  "plugins": ["@kdujs/babel-sugar-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 specifically declare `h` as first parameter in your `render()` function.

```js
// Without @kdujs/babel-sugar-inject-h
export default {
  render (h) {
    return <button />
  }
}

// With @kdujs/babel-sugar-inject-h
export default {
  render () {
    return <button />
  }
}
```

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