Skip to content

Commit ebdcc41

Browse files
authored
fix: scope props merge defaultProps (alibaba#2716)
1 parent 8f5ba69 commit ebdcc41

File tree

1 file changed

+8
-1
lines changed
  • packages/renderer-core/src/renderer

1 file changed

+8
-1
lines changed

packages/renderer-core/src/renderer/base.tsx

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -429,7 +429,14 @@ export default function baseRendererFactory(): IBaseRenderComponent {
429429

430430
__createDom = () => {
431431
const { __schema, __ctx, __components = {} } = this.props;
432-
const scope: any = {};
432+
// merge defaultProps
433+
const scopeProps = {
434+
...__schema.defaultProps,
435+
...this.props,
436+
};
437+
const scope: any = {
438+
props: scopeProps,
439+
};
433440
scope.__proto__ = __ctx || this;
434441

435442
const _children = getSchemaChildren(__schema);

0 commit comments

Comments
 (0)