From 81c43ecc3d17e0dbf7ad1d949b6d977f2c65bd48 Mon Sep 17 00:00:00 2001 From: muhamedsalih-tw <104364298+muhamedsalih-tw@users.noreply.github.com> Date: Thu, 27 Oct 2022 07:13:47 +0530 Subject: fix: 'failed prop' warning in QuickSwitchModal, SettingsNavigation, SettingsWindow and Recipe component tree (#713) * chore: turn off eslint rule @typescript-eslint/no-useless-constructor to initialize dynamic props & state Co-authored-by: Muhamed <> Co-authored-by: Vijay A --- src/components/ui/effects/Appear.tsx | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) (limited to 'src/components/ui/effects/Appear.tsx') diff --git a/src/components/ui/effects/Appear.tsx b/src/components/ui/effects/Appear.tsx index 416017c83..bf097b6a6 100644 --- a/src/components/ui/effects/Appear.tsx +++ b/src/components/ui/effects/Appear.tsx @@ -1,16 +1,16 @@ -import { ReactNode, useEffect, useState } from 'react'; +import { ReactElement, ReactNode, useEffect, useState } from 'react'; import { CSSTransitionGroup } from 'react-transition-group'; -type Props = { +interface IProps { children: ReactNode; - transitionName: string; + transitionName?: string; className?: string; -}; +} const Appear = ({ children, transitionName = 'fadeIn', className = '', -}: Props) => { +}: IProps): ReactElement | null => { const [mounted, setMounted] = useState(false); useEffect(() => { @@ -36,8 +36,4 @@ const Appear = ({ ); }; -Appear.defaultProps = { - className: '', -}; - export default Appear; -- cgit v1.2.3-70-g09d2