[Framer-motion] motion/react vs motion/react-client ๋น๊ต
ยท
๐ STUDY/WEB
Next.js App Router์์ Motion์ ์ฌ์ฉํ๋ค ๋ณด๋ฉด ๋ค์ ๋ ๊ฐ์ง ๋ฐฉ์์ด ์๋ค.// ์ผ๋ฐ์ ์ธ ๋ฐฉ์"use client";import { motion } from "motion/react";// React Server Components ํ๊ฒฝimport * as motion from "motion/react-client";๋์ ์ฐจ์ด๋ ๋จ์ํ import ๊ฒฝ๋ก๊ฐ ์๋๋ผ ์ปดํฌ๋ํธ๊ฐ ์ด๋ ๋ ๋๋ง ๊ฒฝ๊ณ์ ๋ฐฐ์น๋๋์ง, ์๋ฒ์ ํด๋ผ์ด์ธํธ์์ ์ด๋ค ์์
์ด ์ํ๋๋์ง, ๋ธ๋ผ์ฐ์ ๋ก ์ ๋ฌ๋๋ JavaScript์ ๋ฒ์๊ฐ ์ด๋ป๊ฒ ๋ฌ๋ผ์ง๋์ง์ ์๋ค.1. motion/reactmotion/react๋ฅผ ์ฌ์ฉํ๋ ค๋ฉด Motion์ ์ฌ์ฉํ๋ ์ปดํฌ๋ํธ์ "use client"๋ฅผ ์ ์ธํด์ผ ํ๋ค."use client";impo..