From f01def56d87ed58ed45ee23e7e05b14a7470f7ea Mon Sep 17 00:00:00 2001 From: Daniil Suvorov Date: Mon, 15 Jan 2024 15:15:56 +0300 Subject: [PATCH] fix: button add onClick = noop --- packages/vkui/src/components/Button/Button.tsx | 4 ++-- packages/vkui/src/components/Link/Link.tsx | 11 +++++++++-- 2 files changed, 11 insertions(+), 4 deletions(-) diff --git a/packages/vkui/src/components/Button/Button.tsx b/packages/vkui/src/components/Button/Button.tsx index 81e0b93295..3dbb5899c9 100644 --- a/packages/vkui/src/components/Button/Button.tsx +++ b/packages/vkui/src/components/Button/Button.tsx @@ -1,5 +1,5 @@ import * as React from 'react'; -import { classNames, hasReactNode } from '@vkontakte/vkjs'; +import { classNames, hasReactNode, noop } from '@vkontakte/vkjs'; import { useAdaptivity } from '../../hooks/useAdaptivity'; import { usePlatform } from '../../hooks/usePlatform'; import { HasAlign } from '../../types'; @@ -70,7 +70,7 @@ export const Button = ({ after, getRootRef, loading, - onClick, + onClick = noop, className, disableSpinnerAnimation, rounded, diff --git a/packages/vkui/src/components/Link/Link.tsx b/packages/vkui/src/components/Link/Link.tsx index 4c7bff0143..afbb0906d5 100644 --- a/packages/vkui/src/components/Link/Link.tsx +++ b/packages/vkui/src/components/Link/Link.tsx @@ -1,5 +1,5 @@ import * as React from 'react'; -import { classNames } from '@vkontakte/vkjs'; +import { classNames, noop } from '@vkontakte/vkjs'; import { Tappable, TappableProps } from '../Tappable/Tappable'; import styles from './Link.module.css'; @@ -13,10 +13,17 @@ export interface LinkProps extends TappableProps { /** * @see https://vkcom.github.io/VKUI/#/Link */ -export const Link = ({ hasVisited, children, className, ...restProps }: LinkProps) => { +export const Link = ({ + hasVisited, + children, + className, + onClick = noop, + ...restProps +}: LinkProps) => { return (