I have a styled component called Button exported from packages/common (simple React app) that I would like to use in packages/landing-page (NextJs application).
When importing styled-components like this:
import styled, { css } from "styled-components";
const Button = styled.button`
// ...
`
the component works fine in my packages/landing-page app, but since it's server-side rendered, I get the classic server and client mismatch between styled components classes. I solved this problem for components internal to the NextJs project, importing always from styled-components/macro.
BUT this does not solve the mismatch for the imported styled component from packages/common.
How to solve the mismatch when the component comes from a different package?