pupt-lib 1.2.0 → 1.2.1
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/dist/index.js +6 -9
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -369,15 +369,12 @@ async function renderChildrenFallback(children, state) {
|
|
|
369
369
|
}
|
|
370
370
|
async function renderComponentWithValidation(type, componentName, props, children, state, renderFn, resolveFn) {
|
|
371
371
|
const schema = getSchema(type);
|
|
372
|
-
if (
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
if (validationErrors.length > 0) {
|
|
379
|
-
state.context.errors.push(...validationErrors);
|
|
380
|
-
return renderChildrenFallback(children, state);
|
|
372
|
+
if (schema) {
|
|
373
|
+
const validationErrors = validateProps(componentName, { ...props, children }, schema);
|
|
374
|
+
if (validationErrors.length > 0) {
|
|
375
|
+
state.context.errors.push(...validationErrors);
|
|
376
|
+
return renderChildrenFallback(children, state);
|
|
377
|
+
}
|
|
381
378
|
}
|
|
382
379
|
try {
|
|
383
380
|
let resolvedValue;
|