I sell Framer code components, and one of them worked perfectly in the editor, then threw a hydration error on the published site. The page still rendered, but the console showed React error #425 ("text content does not match server-rendered HTML").
The cause was two kinds of characters in the CSS: quotes and > .
The setup
Framer code components are React components. A common way to ship their styles is a <style> element with a template string inside:
export default function Accordion ( props ) { return ( < div className = "acc" > < style > { ` .acc [data-state="open"] .panel { display: block; } .acc > .item { border-top: 1px solid #ddd; } ` } </ style > { /* ... */ } </ div > ) }
Enter fullscreen mode
Exit fullscreen mode
In the editor this is fine, because the editor renders on the client only.…