Skip to content
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

Conflicting theme prop in styled component #3127

Open
thisisauniquegithubusername opened this issue Nov 22, 2023 · 1 comment
Open

Conflicting theme prop in styled component #3127

thisisauniquegithubusername opened this issue Nov 22, 2023 · 1 comment

Comments

@thisisauniquegithubusername
Copy link

Current behavior:

If a component with a theme prop is styled, the theme prop can no longer be used

To reproduce:
https://codesandbox.io/p/sandbox/crazy-leaf-jfykrj?file=%2Fsrc%2FEditor.tsx

const StyledEditor = styled(CodeMirror)``;

function Editor({ input }) {
  return (
    <div>
      <StyledEditor
        value={input}
        theme={dracula}
      />
      <CodeMirror
        value={input}
        theme={dracula}
      />
    </div>
  );
}

Expected behavior:

There should be some workaround to use the theme prop. Right now there is an error trying to build the code locally and in codesandbox the theme is not applied

Environment information:

  • react version: 18.2.0
  • @emotion/react version: 11.11.1
@nickpoindexter
Copy link

+1 I also have this issue

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants