From 4eaa0322344bde4bd522d15525863d99c3782fc7 Mon Sep 17 00:00:00 2001 From: Geoff Cox Date: Sun, 16 Jan 2022 15:38:27 -0800 Subject: [PATCH] refactor(custom-component): use condensed notation --- src/demo/components/custom-component-js.js | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/demo/components/custom-component-js.js b/src/demo/components/custom-component-js.js index 8ac8d07b..50481a67 100644 --- a/src/demo/components/custom-component-js.js +++ b/src/demo/components/custom-component-js.js @@ -7,13 +7,11 @@ import Form from 'mson/lib/form'; import TextField from 'mson/lib/fields/text-field'; class CustomComponentJS extends UIComponent { - // className is needed as JS minification strips the constructor name - className = 'CustomComponentJS'; + constructor(props) { + super({ + // name is needed as JS minification strips the constructor name + name: 'CustomComponentJS', - create(props) { - super.create(props); - - this.set({ schema: new Form({ fields: [ new TextField({ @@ -24,6 +22,8 @@ class CustomComponentJS extends UIComponent { }), ], }), + + ...props, }); } }