@onehat/ui 0.2.7 → 0.2.8

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.7",
3
+ "version": "0.2.8",
4
4
  "description": "Base UI for OneHat apps",
5
5
  "main": "src/index.js",
6
6
  "type": "module",
@@ -25,12 +25,12 @@
25
25
  "ckeditor5-custom-build": "file:ckeditor5",
26
26
  "js-cookie": "^3.0.1",
27
27
  "native-base": "^3.4.25",
28
+ "react-datetime": "^3.2.0",
28
29
  "react-hook-form": "^7.43.1"
29
30
  },
30
31
  "peerDependencies": {
31
32
  "react": "*",
32
33
  "react-color": "^2.19.3",
33
- "react-datetime": "^3.2.0",
34
34
  "react-draggable": "^4.4.5",
35
35
  "react-dom": "*",
36
36
  "react-native": "*"
@@ -192,12 +192,7 @@ 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;
196
- if (isValidElement(Element)) {
197
- element = Element;
198
- debugger;
199
- } else {
200
- element = <Element
195
+ let element = <Element
201
196
  name={name}
202
197
  value={value}
203
198
  setValue={(newValue) => {
@@ -211,7 +206,6 @@ function Form(props) {
211
206
  // {...defaults}
212
207
  // {...propsToPass}
213
208
  />;
214
- }
215
209
 
216
210
  // element = <Tooltip key={ix} label={header} placement="bottom">
217
211
  // {element}
@@ -346,6 +340,9 @@ function Form(props) {
346
340
  isDirty,
347
341
  error,
348
342
  } = fieldState;
343
+ if (isValidElement(Element)) {
344
+ throw new Error('Should not yet be valid React element. Did you use <Element> instead of () => <Element> when defining it?')
345
+ }
349
346
  let element = <Element
350
347
  name={name}
351
348
  value={value}