Skip to content

Commit

Permalink
fix: make default props on root optional
Browse files Browse the repository at this point in the history
  • Loading branch information
chrisvxd committed Aug 15, 2023
1 parent d98eb29 commit dc5b1ae
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions packages/core/types/Config.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -52,10 +52,11 @@ export type Fields<
};

export type ComponentConfig<
ComponentProps extends DefaultComponentProps = DefaultComponentProps
ComponentProps extends DefaultComponentProps = DefaultComponentProps,
DefaultProps = ComponentProps
> = {
render: (props: ComponentProps) => ReactElement;
defaultProps?: ComponentProps;
defaultProps?: DefaultProps;
fields?: Fields<ComponentProps>;
};

Expand All @@ -66,7 +67,10 @@ export type Config<
components: {
[ComponentName in keyof Props]: ComponentConfig<Props[ComponentName]>;
};
root?: ComponentConfig<RootProps & { children: ReactNode }>;
root?: ComponentConfig<
RootProps & { children: ReactNode },
Partial<RootProps & { children: ReactNode }>
>;
};

type MappedItem<Props extends { [key: string]: any } = { [key: string]: any }> =
Expand Down

0 comments on commit dc5b1ae

Please sign in to comment.