1.0.10 • Published 6 years ago

jsx-serializers v1.0.10

Weekly downloads
1
License
MIT
Repository
github
Last release
6 years ago

jsx-serializers

collection of jsx serializers which can be injected by using the jsxstatement when compiling with babel

Usage

This module does currently only work with babel. Install the necessary presets:

npm install --save-dev babel-cli babel-polyfill babel-preset-env babel-preset-react

Then create a .babelrc file to configure the presets:

{
    "presets": ["env", "react"]
}

Install this module:

npm install jsx-serializers --save

You are now ready to use the custom jsx-serializers:

/** @jsx renderHTMLDomTree */ // <- specifies which rendering engine to use
import { renderHTMLDomTree } from "jsx-serializers";

const htmlUserFragment = function (_id, _name) {
    return (<div>
        <h2>{_name}</h2>
        <p>{_id}</p>
    </div>);
};

You can do the very same but serialize it to JSON using renderJSONDomTree. More serializers are soon to come.

1.0.10

6 years ago

1.0.9

6 years ago

1.0.8

6 years ago

1.0.7

6 years ago

1.0.6

6 years ago

1.0.5

6 years ago

1.0.4

6 years ago

1.0.3

6 years ago

1.0.2

6 years ago

1.0.1

6 years ago

1.0.0

6 years ago