Skip to content

Commit

Permalink
Remove styles as it should not be passed to dom nodes
Browse files Browse the repository at this point in the history
  • Loading branch information
Markionium committed Jun 3, 2018
1 parent 53b049f commit 742b349
Showing 1 changed file with 4 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -69,8 +69,8 @@ export class LinkBase extends BaseComponent<ILinkProps, any> implements ILink {
}
}

private _removeInvalidPropsForRootType(RootType: string | React.ComponentClass | React.StatelessComponent, props: ILinkProps): Partial<ILinkProps> {
// Deconstruct the props so we remove props like `as`, `theme` and `getStyles`
private _removeInvalidPropsForRootType(RootType: string | React.ComponentClass | React.StatelessComponent, props: ILinkProps & { getStyles?: any }): Partial<ILinkProps> {
// Deconstruct the props so we remove props like `as`, `theme` and `styles`
// as those will always be removed. We also take some props that are optional
// based on the RootType.
const {
Expand All @@ -81,8 +81,9 @@ export class LinkBase extends BaseComponent<ILinkProps, any> implements ILink {
href,
theme,
getStyles,
styles,
...restProps
} = this.props;
} = props;

// RootType will be a string if we're dealing with an html component
if (typeof RootType === 'string') {
Expand Down

0 comments on commit 742b349

Please sign in to comment.