@onehat/ui 0.2.6 → 0.2.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@onehat/ui",
3
- "version": "0.2.6",
3
+ "version": "0.2.7",
4
4
  "description": "Base UI for OneHat apps",
5
5
  "main": "src/index.js",
6
6
  "type": "module",
@@ -1,4 +1,4 @@
1
- import { useEffect, useState, } from 'react';
1
+ import { useEffect, useState, isValidElement, } from 'react';
2
2
  import {
3
3
  Box,
4
4
  Button,
@@ -192,7 +192,12 @@ function Form(props) {
192
192
  // Getting an error that the OrdersEditor is missing users__email.
193
193
  // Why is this even on the OrdersEditor? Runner?
194
194
  }
195
- let element = <Element
195
+ let element;
196
+ if (isValidElement(Element)) {
197
+ element = Element;
198
+ debugger;
199
+ } else {
200
+ element = <Element
196
201
  name={name}
197
202
  value={value}
198
203
  setValue={(newValue) => {
@@ -206,6 +211,7 @@ function Form(props) {
206
211
  // {...defaults}
207
212
  // {...propsToPass}
208
213
  />;
214
+ }
209
215
 
210
216
  // element = <Tooltip key={ix} label={header} placement="bottom">
211
217
  // {element}
@@ -251,7 +257,7 @@ function Form(props) {
251
257
  type = t;
252
258
  editorTypeProps = p;
253
259
  }
254
- if (type.match(/Combo$/) && Repository?.isRemote && !Repository?.isLoaded) {
260
+ if (type?.match && type.match(/Combo$/) && Repository?.isRemote && !Repository?.isLoaded) {
255
261
  editorTypeProps.autoLoad = true;
256
262
  }
257
263
  const Element = getComponentFromType(type);