From 9ff05072a87706aa0f9c8be85c0e086c1199e3bf Mon Sep 17 00:00:00 2001 From: Anastasia Yaskevich Date: Wed, 3 Jul 2024 11:30:16 +0200 Subject: [PATCH] chore: Refactored OverflowMenu dependency's defaultProps --- src/components/ui/popover/popover.component.tsx | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/components/ui/popover/popover.component.tsx b/src/components/ui/popover/popover.component.tsx index 6856fb361..1e7c9f117 100644 --- a/src/components/ui/popover/popover.component.tsx +++ b/src/components/ui/popover/popover.component.tsx @@ -107,10 +107,6 @@ interface State { */ export class Popover extends React.Component { - static defaultProps: Partial = { - placement: PopoverPlacements.BOTTOM, - }; - public state: State = { childFrame: Frame.zero(), forceMeasure: false, @@ -120,8 +116,12 @@ export class Popover extends React.Component { private placementService: PopoverPlacementService = new PopoverPlacementService(); + private get placement(): PopoverPlacement | string { + return this.props.placement ?? PopoverPlacements.BOTTOM; + } + private get preferredPlacement(): PopoverPlacement { - return PopoverPlacements.parse(this.props.placement); + return PopoverPlacements.parse(this.placement); } private get contentFlexPosition(): StyleProp {