Skip to content
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
68 changes: 49 additions & 19 deletions src/demo/components/custom-component.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down