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

`react-dom` should be an optional peerDependency #4257

Open wojtekmaj opened 3 months ago

wojtekmaj commented 3 months ago

Environment

System:

Steps to reproduce

Install styled-components in a project that does not use react-dom (e.g. React Native project).

Expected Behavior

Yarn not to produce a warning

Actual Behavior

Yarn produces the following warning:

➤ YN0002: │ bubblejoy-app-native@workspace:. doesn't provide react-dom (p9a0a1), requested by styled-components.

and thus needs a workaround:

packageExtensions:
  styled-components@*:
    peerDependenciesMeta:
      react-dom:
        optional: true