Questions about Next.js SSR with motion. #3184
-
🚀 ContextNext.js 15’s App Router encourages pushing the 💡 IdeaExport each motion element from a tiny “index” file: // motion-index.ts
"use client";
import { motion } from "motion/react";
export const MotionDiv = motion.div;
// export other tags only if / when you need them Then in a server component: import { MotionDiv } from "@/index";
export default function Page() {
return (
<MotionDiv
initial={{ opacity: 0 }}
animate={{ opacity: 1 }}
transition={{ duration: 0.6 }}
>
{/* ...content... */}
</MotionDiv>
);
}
❓ Question to the Motion teamIf this gains real-world perf wins so easily, why isn’t something like it baked into Eager to hear thoughts—thanks! |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
Check out the RSC import here: https://motion.dev/docs/react-motion-component#usage |
Beta Was this translation helpful? Give feedback.
Check out the RSC import here: https://motion.dev/docs/react-motion-component#usage