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

[BUG] Using styled components in JS plugin #5414

Open
1 of 3 tasks
kunver400 opened this issue Jan 21, 2025 · 1 comment
Open
1 of 3 tasks

[BUG] Using styled components in JS plugin #5414

kunver400 opened this issue Jan 21, 2025 · 1 comment
Labels
bug Bug fixes

Comments

@kunver400
Copy link

kunver400 commented Jan 21, 2025

Describe the problem

Using ThemeProvider, createGlobalStyle from styled-components breaks the app with react 130 violation.
this issue can be worked around temporarily by not externalizing the dependency.
using vite config from : https://github.com/voxel51/hello-world-plugin-js/blob/main/vite.config.ts

Code to reproduce issue

import { useTheme } from "@fiftyone/components";
const theme = useTheme();
...
    <ThemeProvider theme={theme}>
      <BrandedContainer>
       ...
      </BrandedContainer>
    </ThemeProvider>

System information

  • Linux Ubuntu 22.04, WSL2
  • Python 3.10.12
  • FiftyOne v1.2.0, Voxel51, Inc.
  • Source install
  • Node v18.12.0

Willingness to contribute

The FiftyOne Community encourages bug fix contributions. Would you or another
member of your organization be willing to contribute a fix for this bug to the
FiftyOne codebase?

  • Yes. I can contribute a fix for this bug independently
  • Yes. I would be willing to contribute a fix for this bug with guidance
    from the FiftyOne community
  • No. I cannot contribute a bug fix at this time
@kunver400 kunver400 added the bug Bug fixes label Jan 21, 2025
@kunver400
Copy link
Author

more clues

following import seems to fix the issue
import { createGlobalStyle, ThemeProvider } from 'styled-components/dist/styled-components';

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

No branches or pull requests

1 participant