Skip to content

Commit

Permalink
fix(Popover): rm mutation hook arguments (#7472)
Browse files Browse the repository at this point in the history
- see #6920

---

> Mutating component props or hook arguments is not allowed

Убираем мутации аргументов хука, так как это не поддерживается реакт компилятором
  • Loading branch information
SevereCloud authored Aug 29, 2024
1 parent f0ecd6d commit da815e4
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions packages/vkui/src/components/Popover/Popover.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -225,9 +225,6 @@ export const Popover = ({
let popover: React.ReactNode = null;
if (shown || keepMounted) {
const hidden = keepMounted && !shown;
if (!hidden) {
floatingProps.style.zIndex = String(zIndex);
}

let arrow: React.ReactElement | null = null;
if (withArrow) {
Expand All @@ -250,6 +247,10 @@ export const Popover = ({
ref={refs.setFloating}
className={classNames(styles['Popover'], hidden && styles['Popover--hidden'])}
{...floatingProps}
style={{
zIndex: !hidden ? zIndex : undefined,
...floatingProps.style,
}}
>
<FocusTrap
{...restPopoverProps}
Expand Down

0 comments on commit da815e4

Please sign in to comment.