Skip to content

Commit

Permalink
fix: nested object expressions as props in ExternalComponents (#35)
Browse files Browse the repository at this point in the history
  • Loading branch information
prevwong authored May 15, 2023
1 parent de97826 commit d653f03
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 3 deletions.
5 changes: 5 additions & 0 deletions .changeset/spicy-lamps-itch.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@rekajs/types': patch
---

Fix nested object expressions as props in ExternalComponents
4 changes: 2 additions & 2 deletions packages/types/src/generated/types.generated.ts
Original file line number Diff line number Diff line change
Expand Up @@ -529,13 +529,13 @@ type ExternalComponentViewParameters = {
owner?: ComponentView | null;
component: ExternalComponent;
children?: View[];
props: Record<string, string | number | boolean | Function>;
props: Record<string, any>;
};

export class ExternalComponentView extends ComponentView {
declare component: ExternalComponent;
declare children: View[];
declare props: Record<string, string | number | boolean | Function>;
declare props: Record<string, any>;
constructor(value: ExternalComponentViewParameters) {
super('ExternalComponentView', value);
}
Expand Down
2 changes: 1 addition & 1 deletion packages/types/src/types.definition.ts
Original file line number Diff line number Diff line change
Expand Up @@ -267,7 +267,7 @@ Schema.define('ExternalComponentView', {
fields: (t) => ({
component: t.node('ExternalComponent'),
children: t.defaultValue(t.array(t.node('View')), []),
props: t.map(t.union(t.string, t.number, t.boolean, t.func)),
props: t.map(t.any),
}),
});

Expand Down

0 comments on commit d653f03

Please sign in to comment.