From f390254547ed233262120eeec88c4689aaf2e69e Mon Sep 17 00:00:00 2001 From: Frad LEE Date: Thu, 4 May 2023 22:25:12 +0800 Subject: [PATCH] fix(cmpts): defining component during render --- components/Landing/Hero/DotCircle.tsx | 36 ++++++++++++++++----------- 1 file changed, 21 insertions(+), 15 deletions(-) diff --git a/components/Landing/Hero/DotCircle.tsx b/components/Landing/Hero/DotCircle.tsx index 807ec28..f28bd53 100644 --- a/components/Landing/Hero/DotCircle.tsx +++ b/components/Landing/Hero/DotCircle.tsx @@ -7,6 +7,26 @@ import { secondaryTransition, } from '@/utils/motion/springTransitions' +interface IArrowProps { + controls: ReturnType + isInteractive?: boolean +} + +function Arrow({ controls, isInteractive }: IArrowProps) { + if (!isInteractive) return null + + return ( + + + + + + ) +} + interface IDotCircleProps { isInteractive?: boolean } @@ -29,20 +49,6 @@ function DotCircle({ isInteractive }: IDotCircleProps) { }, } - function Arrow() { - if (!isInteractive) return null - return ( - - - - - - ) - } - return ( - +