styled-components / styled-components

Visual primitives for the component age. Use the best bits of ES6 and CSS to style your apps without stress 💅
https://styled-components.com
MIT License
40.11k stars 2.48k forks source link

Feature request for v5 to ease migration to v6 of large ecosystems #4281

Open Kegulf opened 1 month ago

Kegulf commented 1 month ago

Problem

I work at a company where we have quite a bit of internal open source (code open sourced internally in the company and in use by all teams). We use styled-components for all our styling.

I see an issue after upgrading some of our shared libs to styled v6. We want to use the named export (code ex) to silence a lint-rule relating to "use named if both named and default exists". As of now we are not able to use the named export in shared libs as this breaks in SPAs. This is because we are stuck on v5 i SPAs until all "styled-props" are converted to transient props in all shared libs (due to breaking change in v6). Classic chicken egg problem 😅

import { styled } from 'styled-components';

image

Suggested feature

Add the named export of styled to v5 as well. Shouldn't cause any problems that I can think of, and it would make the migration process better, at least for me and my co-workers 😁

If this issue is not handled by anyone else I will submit a PR this weekend when I actually have time 😅