diff --git a/src/components/common/ChatLink.tsx b/src/components/common/ChatLink.tsx index f45dfe135..f82bbad27 100644 --- a/src/components/common/ChatLink.tsx +++ b/src/components/common/ChatLink.tsx @@ -8,7 +8,7 @@ import Link from '../ui/Link'; type OwnProps = { className?: string; chatId?: string; - children: any; + children: React.ReactNode; }; const ChatLink: FC = ({ diff --git a/src/components/common/GroupCallLink.tsx b/src/components/common/GroupCallLink.tsx index b11f77b60..cc6bcbc7c 100644 --- a/src/components/common/GroupCallLink.tsx +++ b/src/components/common/GroupCallLink.tsx @@ -10,7 +10,7 @@ import { getDispatch } from '../../lib/teact/teactn'; type OwnProps = { className?: string; groupCall?: Partial; - children: any; + children: React.ReactNode; }; const GroupCallLink: FC = ({ diff --git a/src/components/common/MessageLink.tsx b/src/components/common/MessageLink.tsx index f105e8549..d41a6d44c 100644 --- a/src/components/common/MessageLink.tsx +++ b/src/components/common/MessageLink.tsx @@ -10,7 +10,7 @@ import Link from '../ui/Link'; type OwnProps = { className?: string; message?: ApiMessage; - children: any; + children: React.ReactNode; }; const MessageLink: FC = ({ diff --git a/src/components/common/SafeLink.tsx b/src/components/common/SafeLink.tsx index 8cd36bcca..065257f9b 100644 --- a/src/components/common/SafeLink.tsx +++ b/src/components/common/SafeLink.tsx @@ -12,7 +12,7 @@ type OwnProps = { url?: string; text: string; className?: string; - children?: any; + children?: React.ReactNode; isRtl?: boolean; }; diff --git a/src/components/common/UiLoader.tsx b/src/components/common/UiLoader.tsx index a9cb5884f..4d0e07845 100644 --- a/src/components/common/UiLoader.tsx +++ b/src/components/common/UiLoader.tsx @@ -23,7 +23,7 @@ import { selectIsRightColumnShown, selectTheme } from '../../modules/selectors'; type OwnProps = { page: 'main' | 'authCode' | 'authPassword' | 'authPhoneNumber' | 'authQrCode'; - children: any; + children: React.ReactNode; }; type StateProps = diff --git a/src/components/common/UserLink.tsx b/src/components/common/UserLink.tsx index 4bd3da652..2342a3aa5 100644 --- a/src/components/common/UserLink.tsx +++ b/src/components/common/UserLink.tsx @@ -10,7 +10,7 @@ import { getDispatch } from '../../lib/teact/teactn'; type OwnProps = { className?: string; sender?: ApiUser | ApiChat; - children: any; + children: React.ReactNode; }; const UserLink: FC = ({ diff --git a/src/components/mediaViewer/PanZoom.tsx b/src/components/mediaViewer/PanZoom.tsx index 6ab922378..220b10e23 100644 --- a/src/components/mediaViewer/PanZoom.tsx +++ b/src/components/mediaViewer/PanZoom.tsx @@ -20,7 +20,7 @@ export interface IDragData { } export interface OwnProps { - children: any; + children: React.ReactNode; className?: string; noWrap: boolean; canPan: boolean; diff --git a/src/components/middle/message/MentionLink.tsx b/src/components/middle/message/MentionLink.tsx index bc9e9f41c..8be7f4044 100644 --- a/src/components/middle/message/MentionLink.tsx +++ b/src/components/middle/message/MentionLink.tsx @@ -8,7 +8,7 @@ import { selectUser } from '../../../modules/selectors'; type OwnProps = { userId?: string; username?: string; - children: any; + children: React.ReactNode; }; type StateProps = { diff --git a/src/components/ui/Button.tsx b/src/components/ui/Button.tsx index b2fff6e17..ba9b837d1 100644 --- a/src/components/ui/Button.tsx +++ b/src/components/ui/Button.tsx @@ -14,7 +14,7 @@ import './Button.scss'; export type OwnProps = { ref?: RefObject; type?: 'button' | 'submit' | 'reset'; - children: any; + children: React.ReactNode; size?: 'default' | 'smaller' | 'tiny'; color?: ( 'primary' | 'secondary' | 'gray' | 'danger' | 'translucent' | 'translucent-white' | 'translucent-black' | 'dark' diff --git a/src/components/ui/ConfirmDialog.tsx b/src/components/ui/ConfirmDialog.tsx index 872de02b4..2891dd457 100644 --- a/src/components/ui/ConfirmDialog.tsx +++ b/src/components/ui/ConfirmDialog.tsx @@ -19,7 +19,7 @@ type OwnProps = { confirmHandler: () => void; confirmIsDestructive?: boolean; isButtonsInOneRow?: boolean; - children?: any; + children?: React.ReactNode; }; const ConfirmDialog: FC = ({ diff --git a/src/components/ui/DropdownMenu.tsx b/src/components/ui/DropdownMenu.tsx index e74ff89bb..2ee132d6e 100644 --- a/src/components/ui/DropdownMenu.tsx +++ b/src/components/ui/DropdownMenu.tsx @@ -13,7 +13,7 @@ type OwnProps = { forceOpen?: boolean; onOpen?: NoneToVoidFunction; onClose?: NoneToVoidFunction; - children: any; + children: React.ReactNode; }; const DropdownMenu: FC = ({ diff --git a/src/components/ui/FloatingActionButton.tsx b/src/components/ui/FloatingActionButton.tsx index 225ea1811..8946159ea 100644 --- a/src/components/ui/FloatingActionButton.tsx +++ b/src/components/ui/FloatingActionButton.tsx @@ -13,7 +13,7 @@ type OwnProps = { ariaLabel?: ButtonProps['ariaLabel']; disabled?: boolean; onClick: () => void; - children: any; + children: React.ReactNode; }; const FloatingActionButton: FC = ({ diff --git a/src/components/ui/InfiniteScroll.tsx b/src/components/ui/InfiniteScroll.tsx index df64a5df5..7bf412c36 100644 --- a/src/components/ui/InfiniteScroll.tsx +++ b/src/components/ui/InfiniteScroll.tsx @@ -25,7 +25,7 @@ type OwnProps = { noScrollRestoreOnTop?: boolean; noFastList?: boolean; cacheBuster?: any; - children: any; + children: React.ReactNode; }; const DEFAULT_LIST_SELECTOR = '.ListItem'; diff --git a/src/components/ui/Link.tsx b/src/components/ui/Link.tsx index 486abaf0b..7aa615b0d 100644 --- a/src/components/ui/Link.tsx +++ b/src/components/ui/Link.tsx @@ -5,7 +5,7 @@ import buildClassName from '../../util/buildClassName'; import './Link.scss'; type OwnProps = { - children: any; + children: React.ReactNode; className?: string; isRtl?: boolean; onClick?: (e: React.MouseEvent) => void; diff --git a/src/components/ui/ListItem.tsx b/src/components/ui/ListItem.tsx index d1a8eaffd..f189c7b4d 100644 --- a/src/components/ui/ListItem.tsx +++ b/src/components/ui/ListItem.tsx @@ -30,7 +30,7 @@ interface OwnProps { secondaryIcon?: string; className?: string; style?: string; - children: any; + children: React.ReactNode; disabled?: boolean; ripple?: boolean; narrow?: boolean; diff --git a/src/components/ui/Menu.tsx b/src/components/ui/Menu.tsx index 7291b45ba..55a6a6691 100644 --- a/src/components/ui/Menu.tsx +++ b/src/components/ui/Menu.tsx @@ -33,7 +33,7 @@ type OwnProps = { onClose?: () => void; onMouseEnter?: (e: React.MouseEvent) => void; onMouseLeave?: (e: React.MouseEvent) => void; - children: any; + children: React.ReactNode; }; const ANIMATION_DURATION = 200; diff --git a/src/components/ui/MenuItem.tsx b/src/components/ui/MenuItem.tsx index 54d68310f..13b1e895c 100644 --- a/src/components/ui/MenuItem.tsx +++ b/src/components/ui/MenuItem.tsx @@ -10,7 +10,7 @@ type OnClickHandler = (e: React.SyntheticEvent void; onCloseAnimationEnd?: () => void; onEnter?: () => void; diff --git a/src/components/ui/Portal.ts b/src/components/ui/Portal.ts index 7ce2563d8..3a61c0376 100644 --- a/src/components/ui/Portal.ts +++ b/src/components/ui/Portal.ts @@ -1,10 +1,10 @@ -import { FC, useRef, useLayoutEffect } from '../../lib/teact/teact'; +import { FC, useRef, useLayoutEffect, VirtualElement } from '../../lib/teact/teact'; import TeactDOM from '../../lib/teact/teact-dom'; type OwnProps = { containerId?: string; className?: string; - children: any; + children: React.ReactNode; }; const Portal: FC = ({ containerId, className, children }) => { @@ -32,7 +32,7 @@ const Portal: FC = ({ containerId, className, children }) => { }; }, [className, containerId]); - return TeactDOM.render(children, elementRef.current); + return TeactDOM.render(children as VirtualElement, elementRef.current); }; export default Portal; diff --git a/src/components/ui/SearchInput.tsx b/src/components/ui/SearchInput.tsx index a09650d14..4bcf0739f 100644 --- a/src/components/ui/SearchInput.tsx +++ b/src/components/ui/SearchInput.tsx @@ -16,7 +16,7 @@ import './SearchInput.scss'; type OwnProps = { ref?: RefObject; - children?: any; + children?: React.ReactNode; parentContainerClassName?: string; className?: string; inputId?: string; diff --git a/src/components/ui/Select.tsx b/src/components/ui/Select.tsx index 53bdcd402..6bd4ad071 100644 --- a/src/components/ui/Select.tsx +++ b/src/components/ui/Select.tsx @@ -12,7 +12,7 @@ type OwnProps = { hasArrow?: boolean; placeholder?: string; onChange?: (e: ChangeEvent) => void; - children: any; + children: React.ReactNode; }; const Select: FC = (props) => {