修改对 children 的调用方式
This commit is contained in:
parent
8c47e84707
commit
3913a77392
|
@ -486,12 +486,12 @@ class SchemaRenderer extends React.Component<SchemaRendererProps, any> {
|
||||||
if (Array.isArray(schema)) {
|
if (Array.isArray(schema)) {
|
||||||
return renderChildren($path, schema, rest) as JSX.Element;
|
return renderChildren($path, schema, rest) as JSX.Element;
|
||||||
} else if (schema.children) {
|
} else if (schema.children) {
|
||||||
return typeof schema.children === 'function' ? schema.children({
|
return React.isValidElement(schema.children) ? schema.children : React.createElement(schema.children as any, {
|
||||||
...rest,
|
...rest,
|
||||||
$path: $path,
|
$path: $path,
|
||||||
render: this.renderChild,
|
render: this.renderChild,
|
||||||
ref: this.refFn,
|
ref: this.refFn,
|
||||||
}, schema) : schema.children;
|
});
|
||||||
} else if (!this.renderer) {
|
} else if (!this.renderer) {
|
||||||
return (
|
return (
|
||||||
<LazyComponent
|
<LazyComponent
|
||||||
|
|
Loading…
Reference in New Issue