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

Some components are not compatible with styled-components v6 #344

Open
arturmiglio opened this issue Jul 24, 2023 · 1 comment
Open

Some components are not compatible with styled-components v6 #344

arturmiglio opened this issue Jul 24, 2023 · 1 comment
Labels
bug Something isn't working

Comments

@arturmiglio
Copy link
Contributor

arturmiglio commented Jul 24, 2023

Some components that use react-select can break (or fail in test environmets) when using styled-components latest (tested with 6.0.5).

  • @freenow/wave version: 1.32.0 (and probably may minors before)

What was expected to happen?

Eg.: PhoneInput, when user opens the Country select, makes the example app (below) crash with:

Cannot read properties of undefined (reading 'borderRadius')

Reproduction

https://codesandbox.io/s/styled-components-6-issue-gffvqg

@nlopin nlopin added the bug Something isn't working label Jul 24, 2023
@arturmiglio
Copy link
Contributor Author

Using styled-components v6 also generates a ton of console.errors since it doesn't check if a prop should be forwarded to the DOM element anymore. All custom props should be using the $ transient prop prefix.

Examples:

  • Warning: React does not recognize the textAlignprop on a DOM element. If you intentionally want it to appear in the DOM as a custom attribute, spell it as lowercasetextalign instead. If you accidentally passed it from a parent component, remove it from the DOM element. from Month (/Users/artur.miglio/Projects/partner-dashboard/node_modules/@freenow/wave/lib/cjs/components/Datepicker/Month.js:21:19);
  • Warning: React does not recognize the isWithinHoverRangeprop on a DOM element. If you intentionally want it to appear in the DOM as a custom attribute, spell it as lowercaseiswithinhoverrange instead. If you accidentally passed it from a parent component, remove it from the DOM element. from Day (/Users/artur.miglio/Projects/partner-dashboard/node_modules/@freenow/wave/lib/cjs/components/Datepicker/Day/index.js:43:23);

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Development

No branches or pull requests

2 participants