mirror of
https://gitee.com/baidu/amis.git
synced 2024-12-05 05:18:34 +08:00
修改对 children 的调用方式
This commit is contained in:
parent
1c8455382e
commit
9276216e72
@ -486,12 +486,12 @@ class SchemaRenderer extends React.Component<SchemaRendererProps, any> {
|
||||
if (Array.isArray(schema)) {
|
||||
return renderChildren($path, schema, rest) as JSX.Element;
|
||||
} 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,
|
||||
$path: $path,
|
||||
render: this.renderChild,
|
||||
ref: this.refFn,
|
||||
}, schema) : schema.children;
|
||||
});
|
||||
} else if (!this.renderer) {
|
||||
return (
|
||||
<LazyComponent
|
||||
|
Loading…
Reference in New Issue
Block a user