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 (