Skip to content

Commit

Permalink
Fix isPivotItem check for IE11 (#19238)
Browse files Browse the repository at this point in the history
  • Loading branch information
behowell authored Aug 4, 2021
1 parent c0e62e6 commit 5369d33
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"type": "patch",
"comment": "Fix Pivot's isPivotItem check for IE11 compatibility",
"packageName": "@fluentui/react",
"email": "[email protected]",
"dependentChangeType": "patch"
}
2 changes: 1 addition & 1 deletion packages/react/src/components/Pivot/Pivot.base.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ const getLinkItems = (props: IPivotProps, pivotId: string): PivotLinkCollection
};

const isPivotItem = (item: React.ReactNode): item is PivotItem => {
return ((item as React.ReactElement)?.type as React.ComponentType)?.name === PivotItem.name;
return React.isValidElement(item) && (item.type as React.ComponentType)?.name === PivotItem.name;
};

export const PivotBase: React.FunctionComponent<IPivotProps> = React.forwardRef<HTMLDivElement, IPivotProps>(
Expand Down

0 comments on commit 5369d33

Please sign in to comment.