diff --git a/common/changes/@uifabric/foundation/jg-remove-object-assign-again_2018-09-07-20-55.json b/common/changes/@uifabric/foundation/jg-remove-object-assign-again_2018-09-07-20-55.json new file mode 100644 index 00000000000000..262df1d7581da4 --- /dev/null +++ b/common/changes/@uifabric/foundation/jg-remove-object-assign-again_2018-09-07-20-55.json @@ -0,0 +1,11 @@ +{ + "changes": [ + { + "packageName": "@uifabric/foundation", + "comment": "Remove Object.assign usage to fix IE11 issues.", + "type": "patch" + } + ], + "packageName": "@uifabric/foundation", + "email": "jagore@microsoft.com" +} \ No newline at end of file diff --git a/packages/foundation/src/createComponent.tsx b/packages/foundation/src/createComponent.tsx index df9c17303e2987..5088ad9aa31e4c 100644 --- a/packages/foundation/src/createComponent.tsx +++ b/packages/foundation/src/createComponent.tsx @@ -146,14 +146,18 @@ export function createComponent< // TODO: Should 'rest' props from customizations pass onto view? They are not currently. // (items like theme seem like they shouldn't) const propStyles = processedProps.styles || userProps.styles; - const themedProps: TProcessedProps = Object.assign({}, rest, userProps, processedProps); - const viewProps: IViewComponentProps = Object.assign({}, processedProps, userProps, { - classNames: providers.mergeStyleSets( - _evaluateStyle(themedProps, options.styles), - _evaluateStyle(themedProps, contextStyles), - _evaluateStyle(themedProps, propStyles) - ) - }); + const styleProps: TProcessedProps = { ...rest, ...(processedProps as any), ...(userProps as any) }; + const viewProps: IViewComponentProps = { + ...(processedProps as any), + ...(userProps as any), + ...{ + classNames: providers.mergeStyleSets( + _evaluateStyle(styleProps, options.styles), + _evaluateStyle(styleProps, contextStyles), + _evaluateStyle(styleProps, propStyles) + ) + } + }; // TODO: consider rendering view as JSX component with display name in debug mode to aid in debugging return options.view(viewProps); @@ -204,14 +208,17 @@ export function createStatelessComponent< // TODO: Should 'rest' props from customizations pass onto view? They are not currently. // (items like theme seem like they shouldn't) const { styles: propStyles } = processedProps; - const themedProps: TProcessedProps = Object.assign({}, rest, processedProps); - const viewProps: IViewComponentProps = Object.assign({}, processedProps, { - classNames: providers.mergeStyleSets( - _evaluateStyle(themedProps, options.styles), - _evaluateStyle(themedProps, contextStyles), - _evaluateStyle(themedProps, propStyles) - ) - }); + const styleProps: TProcessedProps = { ...rest, ...(processedProps as any) }; + const viewProps: IViewComponentProps = { + ...(processedProps as any), + ...{ + classNames: providers.mergeStyleSets( + _evaluateStyle(styleProps, options.styles), + _evaluateStyle(styleProps, contextStyles), + _evaluateStyle(styleProps, propStyles) + ) + } + }; // TODO: consider rendering view as JSX component with display name in debug mode to aid in debugging return options.view(viewProps);