-
-
Notifications
You must be signed in to change notification settings - Fork 885
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
"How do you use motion in SSR environment with Next.js 14? #2902
Comments
@jungsikjeong, you can achieve it by importing the This is mentioned on the It's kind of hidden, but it worked for me inside a React Server Component. |
@leoreisdias : |
@leoreisdias Thanks for solving this! Do you think there's some way we could make this more obvious? Maybe it'd be clearer with a specific integration guide like we have for Vue and Framer on https://motion.dev/docs |
@leoreisdias Isn't it a React server component? How should I use it in Next.js's SSR environment? 😢 |
@mattgperry A specific integration would be nice, even more considering that it would be possible to add not just these particular details about importing, but also for things like "Do and Don't", for example, the fact that custom motion components originated from For a faster approach, I would suggest just adding this importing detail into the Getting Start, close to the "React 19 / Next 15" section at https://motion.dev/docs/react-quick-start#react-19-next-15. (It was the first spot I've looked for). I think it makes for being related. |
@jungsikjeong It is for the React Server Components approach. Are you using Page or App Router? This importing pattern will work on the App Router (React Server Components). Idk if it might work the same in Page Router. |
@leoreisdias Are there any other recommended approaches besides the above method? |
That's weird. I'm using Motion APIs inside App Router without 'use client'. The only thing I couldn't do was create a custom motion component with |
It matches the title.
How should I use it?
I had to declare 'use client' at the top to use it..
Is there any other way?"
The text was updated successfully, but these errors were encountered: