Numerous Philanthropic Misanthropes

    bisheng-plugin-react

    1.1.2 • Public • Published

    bisheng-plugin-react

    npm package NPM downloads Dependency Status

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

    Usage

    Install:

    npm i --save bisheng-plugin-react

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

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

    In Markdown:

    ...
    
    This is a button:
    
    ```jsx
    import { Button } from 'antd';
    ReactDOM.render(<Button>Click!</Button>, mountNode);
    ```
    ...
    

    The above example will be rendered as:

    screenshot

    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

    Install

    npm i bisheng-plugin-react

    DownloadsWeekly Downloads

    3,738

    Version

    1.1.2

    License

    MIT

    Unpacked Size

    19.4 kB

    Total Files

    7

    Last publish

    Collaborators

    • benjycui
    • afc163
    • zombiej
    • ycjcl868