SHARE
TWEET

Untitled

a guest Apr 24th, 2019 72 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. import React, { Component } from "react";
  2. import { render } from "react-dom";
  3.  
  4. import { JsonUiRenderer } from 'afc-renderer';
  5. import { registry } from 'afc-web-components';
  6.  
  7. const Form = JsonUiRenderer(registry);
  8.  
  9. const schema = {
  10.   title: "Todo",
  11.   type: "object",
  12.   required: ["title"],
  13.   properties: {
  14.     title: {type: "string", title: "Title", default: "A new task"},
  15.     done: {type: "boolean", title: "Done?", default: false}
  16.   }
  17. };
  18.  
  19. const log = (type) => console.log.bind(console, type);
  20.  
  21. render((
  22.   <Form schema={schema}
  23.         onChange={log("changed")}
  24.         onSubmit={log("submitted")}
  25.         onError={log("errors")} />
  26. ), document.getElementById("app"));
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top