[BUG] React DOM Server Fails to Render Animated Elements
See original GitHub issueIssue
When you call ReactDOMServer.renderToStaticMarkup()
with a component that uses framer-motion to render it fails to render those elements but renders non-animated elements correctly. Even with passing { type: false }
to the transition it still fails.
Example
- Repo: https://github.com/amcdnl/reaviz-ssr
- Code: https://github.com/jask-oss/reaviz/blob/master/src/BarChart/BarSeries/Bar.tsx#L328-L347
Notes on example:
- This example uses puppeteer but it also produced the same result with nextjs
- All of the elements that are not rendered by motion are rendered fine (you can see the axis) but the
motion.rect
are not rendered.
Versions
"react": "16.9.0"
"react-dom": "16.9.0"
"framer-motion": "^1.6.7"
Issue Analytics
- State:
- Created 4 years ago
- Reactions:1
- Comments:11
Top Results From Across the Web
Why is using AnimatePresence from framer motion causing ...
The error only occurs when using AnimatePresence. Server Error Error: Element type is invalid: expected a string (for built-in components) ...
Read more >Debugging and fixing hydration issues - somewhat abstract
It is almost working beautifully, but when we tried to hydrate our SSR (server-side rendered) result, we hit a snag; our SSR result...
Read more >ReactDOMServer – React
The ReactDOMServer object enables you to render components to static markup. Typically, it's used on a Node server: // ES modules import *...
Read more >8 common React error messages and how to address them
Learn about the most common error messages in React Development and the meaning behind them, the error itself, and how to fix it....
Read more >Troubleshooting | React Navigation
You can install the latest versions by installing the packages again (e.g. npm install package-name ). I'm getting an error "Unable to resolve...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Hmm that’s odd, we have SSR-specific tests that work fine. I’ll take a look.
If I passed animate I got the same result, a <rect>