diff --git a/src/demo/components/custom-component.js b/src/demo/components/custom-component.js index 7f6912e9..fc5abff3 100644 --- a/src/demo/components/custom-component.js +++ b/src/demo/components/custom-component.js @@ -4,27 +4,57 @@ import Form from 'mson/lib/form'; import TextField from 'mson/lib/fields/text-field'; import attach from '../../attach'; import Typography from '@material-ui/core/Typography'; +// import MSONComponent from 'mson/lib/component/mson-component'; -class CustomComponent extends UIComponent { - _className = 'CustomComponent'; - - _create(props) { - super._create(props); - - this.set({ - schema: new Form({ - fields: [ - new TextField({ - name: 'name', - }), - new TextField({ - name: 'label', - }), - ], +// class CustomComponent extends UIComponent { +// _className = 'CustomComponent'; + +// _create(props) { +// super._create(props); + +// this.set({ +// schema: new Form({ +// fields: [ +// new TextField({ +// name: 'name', +// }), +// new TextField({ +// name: 'label', +// }), +// ], +// }), +// }); +// } +// } + +// const CustomComponent = new MSONComponent({ +// name: 'CustomComponent', +// schema: new Form({ +// fields: [ +// new TextField({ +// name: 'name', +// }), +// new TextField({ +// name: 'label', +// }), +// ], +// }) +// }) + +const CustomComponent = () => ({ + component: UIComponent, + name: 'CustomComponent', + schema: new Form({ + fields: [ + new TextField({ + name: 'name', + }), + new TextField({ + name: 'label', }), - }); - } -} + ], + }), +}); let CustomComponentUI = (props) => { const { name, label } = props;