自定义组件验证问题修复

This commit is contained in:
2betop 2020-06-03 12:41:41 +08:00
parent c773a17281
commit 760158ee3a
1 changed files with 2 additions and 0 deletions

View File

@ -596,10 +596,12 @@ class SchemaRenderer extends React.Component<SchemaRendererProps, any> {
render: this.renderChild
});
} else if (typeof schema.component === 'function') {
const isSFC = !(schema.component.prototype instanceof React.Component);
return React.createElement(schema.component as any, {
...rest,
...schema,
$path: $path,
ref: isSFC ? undefined : this.refFn,
render: this.renderChild
});
} else if (!this.renderer) {