# bisheng-plugin-react

> To convert JSX which is written in Markdown to React.Element.

Latest version **1.2.3** (published 2023-09-26) · MIT license · 0 weekly downloads

## Install

```sh
npm install bisheng-plugin-react
pnpm add bisheng-plugin-react
yarn add bisheng-plugin-react
bun add bisheng-plugin-react
```

## 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.2.3 |
| Published | 2023-09-26 |
| First published | 2016-05-24 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Node | >=8.6.0 |
| Dependencies | 10 |
| Unpacked size | 21.2 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 7 |
| Author | Benjy Cui |
| Maintainers | benjycui, afc163, zombiej, ycjcl868, madccc |
| Keywords | bisheng, plugin, markdown, react |

## Links

- npm: https://www.npmjs.com/package/bisheng-plugin-react
- Repository: https://github.com/benjycui/bisheng-plugin-react
- Homepage: https://github.com/benjycui/bisheng-plugin-react#readme
- Issues: https://github.com/benjycui/bisheng-plugin-react/issues
- npm.io page: https://npm.io/package/bisheng-plugin-react

## Dependencies (10)

- [@babel/core](https://npm.io/package/@babel/core.md) ^7.0.0
- [@babel/types](https://npm.io/package/@babel/types.md) ^7.0.0
- [@babel/traverse](https://npm.io/package/@babel/traverse.md) ^7.0.0
- [@babel/generator](https://npm.io/package/@babel/generator.md) ^7.0.0
- [@babel/preset-env](https://npm.io/package/@babel/preset-env.md) ^7.0.0
- [@babel/preset-react](https://npm.io/package/@babel/preset-react.md) ^7.0.0
- [@babel/plugin-proposal-decorators](https://npm.io/package/@babel/plugin-proposal-decorators.md) ^7.1.6
- [@babel/plugin-transform-typescript](https://npm.io/package/@babel/plugin-transform-typescript.md) ^7.4.5
- [@babel/plugin-proposal-class-properties](https://npm.io/package/@babel/plugin-proposal-class-properties.md) ^7.0.0
- [@babel/plugin-proposal-object-rest-spread](https://npm.io/package/@babel/plugin-proposal-object-rest-spread.md) ^7.0.0

## Alternatives

- [mobx-react](https://npm.io/package/mobx-react.md) — 2.8M weekly downloads
- [rc-tree](https://npm.io/package/rc-tree.md) — 2.6M weekly downloads
- [@react-oauth/google](https://npm.io/package/@react-oauth/google.md) — 1.3M weekly downloads
- [@wagmi/connectors](https://npm.io/package/@wagmi/connectors.md) — 877.0K weekly downloads
- [vee-validate](https://npm.io/package/vee-validate.md) — 836.4K weekly downloads

## Recent versions

- 1.2.3 (latest) — 2023-09-26
- 1.2.2 — 2022-04-24
- 1.2.1 — 2022-04-19
- 1.2.0 — 2022-04-03
- 1.2.0-alpha.0 — 2022-02-16
- 1.1.2 — 2020-12-01
- 1.1.1 — 2019-09-09
- 1.1.0 — 2019-06-21
- 1.0.0 — 2018-12-12
- 0.6.3 — 2017-10-23
- 0.6.2 — 2017-10-23
- 0.6.1 — 2017-10-23
- 0.6.0 — 2017-10-23
- 0.5.8 — 2017-10-17
- 0.5.7 — 2017-10-10
- … 20 more at https://npm.io/package/bisheng-plugin-react/versions

## README

# bisheng-plugin-react

[![](https://img.shields.io/travis/benjycui/bisheng.svg?style=flat-square)](https://travis-ci.org/benjycui/bisheng)
[![npm package](https://img.shields.io/npm/v/bisheng-plugin-react.svg?style=flat-square)](https://www.npmjs.org/package/bisheng-plugin-react)
[![NPM downloads](http://img.shields.io/npm/dm/bisheng-plugin-react.svg?style=flat-square)](https://npmjs.org/package/bisheng-plugin-react)
[![Dependency Status](https://david-dm.org/benjycui/bisheng-plugin-react.svg?style=flat-square)](https://david-dm.org/benjycui/bisheng-plugin-react)

To convert JSX which is written in Markdown to React.Element.

## Usage

Install:

```bash
npm i --save bisheng-plugin-react
```

Add 'bisheng-plugin-react to `bisheng.config.js`'s plugins.

```js
module.exports = {
  plugins: ['bisheng-plugin-react?lang=jsx'],
};
```

In Markdown:

<pre>
...

This is a button:

```jsx
import { Button } from 'antd';
ReactDOM.render(&lt;Button&gt;Click!&lt;/Button&gt;, mountNode);
```
...
</pre>

The above example will be rendered as:

![screenshot](https://raw.githubusercontent.com/benjycui/bisheng/master/packages/bisheng-plugin-react/screenshot.png)

## API

### lang: String

> default: 'react-component'

### babelConfig: Object

> default:
> {
>   presets: [
>     'react',
>     ['env', {
>       targets: {
>         browsers: ['last 2 versions', 'Firefox ESR', '> 1%', 'ie >= 8', 'iOS >= 8', 'Android >= 4'],
>       },
>     }],
>   ],
>   plugins: [
>     'transform-class-properties',
>     'transform-object-rest-spread',
>   ],
> }

### noreact: Boolean

> default: false

Whether to import `React` and `ReactDOM` automatically.

## License

MIT

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