Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"changes": [
{
"packageName": "@uifabric/foundation",
"comment": "Remove Object.assign usage to fix IE11 issues.",
"type": "patch"
}
],
"packageName": "@uifabric/foundation",
"email": "[email protected]"
}
39 changes: 23 additions & 16 deletions packages/foundation/src/createComponent.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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<TProcessedProps, TProcessedStyleSet> = 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<TProcessedProps, TProcessedStyleSet> = {
...(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);
Expand Down Expand Up @@ -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<TProcessedProps, TProcessedStyleSet> = 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<TProcessedProps, TProcessedStyleSet> = {
...(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);
Expand Down