react-json2schema

1.0.1 • Public • Published

Example:

import React from 'react';
import reactSchema from 'react-schema';


class Foo extends React.Component {
  render() {
    return reactSchema({
      type: 'div',
      props: {
        children: [
          {
            type: 'a',
            props: {
              href: '#',
              children: 'Hello'
            }
          }
        ]
      }
    }, {
      div: props => <div {...props} />,
      a: props => <a {...props} />,
    }, ({ type, props }) => (
      <div>{type} {JSON.stringify(props)}</div>
    ));
  }
}

Readme

Keywords

none

Package Sidebar

Install

npm i react-json2schema

Weekly Downloads

7

Version

1.0.1

License

ISC

Unpacked Size

3.09 kB

Total Files

6

Last publish

Collaborators

  • vuquangthinh