fix(union-type): fix union type overridden by default-props type

This commit is contained in:
unix
2020-04-11 20:52:33 +08:00
parent 0312e8c126
commit d1b1d41fda
16 changed files with 36 additions and 29 deletions

View File

@@ -7,7 +7,7 @@ const withDefaults = <P, DP>(
type Props = Partial<DP> & Omit<P, keyof DP>
component.defaultProps = defaultProps
return (component as React.ComponentType<any>) as React.ComponentType<Props>
return component as React.ComponentType<Props>
}
export default withDefaults