From 27e405d9cbc2a987ddc23a52731b644eb627c545 Mon Sep 17 00:00:00 2001 From: Maxwell Barvian Date: Sat, 23 Nov 2024 10:48:41 -0800 Subject: [PATCH] User MotionConfig reduced in example --- .../examples/_Motion/react/Component.tsx | 58 ++++++++++--------- 1 file changed, 30 insertions(+), 28 deletions(-) diff --git a/site/src/pages/[...framework]/examples/_Motion/react/Component.tsx b/site/src/pages/[...framework]/examples/_Motion/react/Component.tsx index 6dd879bf..7a27cdf3 100644 --- a/site/src/pages/[...framework]/examples/_Motion/react/Component.tsx +++ b/site/src/pages/[...framework]/examples/_Motion/react/Component.tsx @@ -1,4 +1,4 @@ -import { motion } from 'motion/react' +import { motion, MotionConfig, MotionContext } from 'motion/react' import NumberFlow, { useCanAnimate } from '@number-flow/react' import { ArrowUp } from 'lucide-react' import clsx from 'clsx/lite' @@ -15,33 +15,35 @@ export default function MotionExample({ value }: Props) { const canAnimate = useCanAnimate() return ( - 0 ? 'bg-emerald-400' : 'bg-red-500', - '~text-base/2xl inline-flex items-center px-[0.3em] text-white transition-colors duration-300' - )} - style={{ borderRadius: 999 }} - layout={canAnimate} - transition={{ layout: { duration: 0.9, bounce: 0, type: 'spring' } }} - > - 0 ? 0 : -180 }} - initial={false} - /> - + 0 ? 'bg-emerald-400' : 'bg-red-500', + '~text-base/2xl inline-flex items-center px-[0.3em] text-white transition-colors duration-300' + )} + style={{ borderRadius: 999 }} layout={canAnimate} - layoutRoot={canAnimate} - /> - + transition={{ layout: { duration: 0.9, bounce: 0, type: 'spring' } }} + > + 0 ? 0 : -180 }} + initial={false} + /> + + + ) }