0.1.1 • Published 4 years ago

react-json-syntax v0.1.1

Weekly downloads
4
License
ISC
Repository
github
Last release
4 years ago

react-json-syntax

An alternative syntax for React.js templates.

NPM

API

usage:

const reactParse = require('react-json-syntax');
return (
  <tag attribute="value">
    text
    <child>
        { this.state.value }
    </child>
  </tag>
);

is the simular as

return reactParse(
    ['tag', {'attribute': 'value'}, [
        'text',
        ['child', [
            this.state.value
        ]]
    ]]
);

alias:

return React.parse(
    ['div', [
        'text',
        [MyComponent, {myProp: 123}]
    ]]
);