react-json2schema

Example:

Usage no npm install needed!

<script type="module">
  import reactJson2schema from 'https://cdn.skypack.dev/react-json2schema';
</script>

README

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>
    ));
  }
}