From 742b349b024cc190de900606cde41ea4d32c35a4 Mon Sep 17 00:00:00 2001 From: Mark Polak Date: Sun, 3 Jun 2018 23:28:11 +0200 Subject: [PATCH] Remove styles as it should not be passed to dom nodes --- .../src/components/Link/Link.base.tsx | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/packages/office-ui-fabric-react/src/components/Link/Link.base.tsx b/packages/office-ui-fabric-react/src/components/Link/Link.base.tsx index 40131b2c5abed..045b61d1d237c 100644 --- a/packages/office-ui-fabric-react/src/components/Link/Link.base.tsx +++ b/packages/office-ui-fabric-react/src/components/Link/Link.base.tsx @@ -69,8 +69,8 @@ export class LinkBase extends BaseComponent implements ILink { } } - private _removeInvalidPropsForRootType(RootType: string | React.ComponentClass | React.StatelessComponent, props: ILinkProps): Partial { - // 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 { + // 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 { @@ -81,8 +81,9 @@ export class LinkBase extends BaseComponent 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') {