Skip to content
Discussion options

You must be logged in to vote

Yes, props work fine with styled-components and the Next.js SWC plugin. Make sure your next.config.js has the styled-components compiler option enabled:

// next.config.js
module.exports = {
  compiler: {
    styledComponents: true,
  },
};

Props-based styling works identically whether you use SWC or Babel — the compiler plugin only handles displayName and SSR optimizations, not runtime behavior.

Replies: 2 comments

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Answer selected by quantizor
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants