Skip to content

Commit

Permalink
fix: scope props merge defaultProps (#2716)
Browse files Browse the repository at this point in the history
  • Loading branch information
1ncounter authored Dec 1, 2023
1 parent 8f5ba69 commit ebdcc41
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion packages/renderer-core/src/renderer/base.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -429,7 +429,14 @@ export default function baseRendererFactory(): IBaseRenderComponent {

__createDom = () => {
const { __schema, __ctx, __components = {} } = this.props;
const scope: any = {};
// merge defaultProps
const scopeProps = {
...__schema.defaultProps,
...this.props,
};
const scope: any = {
props: scopeProps,
};
scope.__proto__ = __ctx || this;

const _children = getSchemaChildren(__schema);
Expand Down

0 comments on commit ebdcc41

Please sign in to comment.