Skip to content

@react-types/* now depend on @react-spectrum/* components, pulling in duplicate react-aria #10139

@sarahgm

Description

@sarahgm

Provide a general summary of the issue here

Several @react-types/* packages, which were historically type-only (depending solely on @react-types/shared), have started depending on full runtime packages, including @react-spectrum/* component packages and @react-aria/* / @react-stately/*. This inverts the expected dependency direction (types should not depend on components/runtime) and pulls a large runtime graph into projects that only want the type definitions.

🤔 Expected Behavior?

@react-types/* packages should remain type-only and depend only on @react-types/shared (and other @react-types/* packages), as they did previously. Installing a type package should not pull in @react-spectrum/* components or a runtime react-aria / react-stately graph.

😯 Current Behavior

Recent releases declare runtime dependencies (verified via npm view <pkg> dependencies):

Package (current) Declares dependency on
@react-types/button@3.16.0 @react-aria/button@^3.15.0, @react-spectrum/button@^3.18.0
@react-types/checkbox@3.11.0 @react-aria/toggle, @react-aria/checkbox, @react-stately/toggle, @react-stately/checkbox, @react-spectrum/checkbox@^3.11.0
@react-types/table@3.14.0 @react-stately/table@^3.16.0, @react-spectrum/table@^3.18.0
@react-types/grid@3.4.0 @react-stately/grid@^3.12.0

The immediately preceding versions were type-only:

Package (last type-only) Dependencies
@react-types/button@3.15.1 @react-types/shared@^3.33.1
@react-types/checkbox@3.10.4 @react-types/shared@^3.33.1
@react-types/table@3.13.6 @react-types/grid@^3.3.8, @react-types/shared@^3.33.1
@react-types/grid@3.3.8 @react-types/shared@^3.33.1

💁 Possible Solution

If the runtime dependencies are intentional, ideally split them out so @react-types/* stays type-only, or document the change and the recommended consumer strategy. If unintentional, revert the dependency additions in a patch.

🔦 Context

We maintain a design system (Marigold) built on react-aria / react-aria-components and Tailwind, not on @adobe/react-spectrum. After a routine dependency bump, our ^ ranges floated @react-types/{button,checkbox,grid,table} into the versions above. This pulled in all of @adobe/react-spectrum and a duplicate react-aria@3.48 / react-stately@3.46 alongside our intended react-aria@3.49 / react-stately@3.47.

The duplicate split the i18n and overlay React contexts, which broke overlays in production. We worked around it by pinning these four packages to their last type-only versions (~3.15 / ~3.10 / ~3.3 / ~3.13), which removes @adobe/react-spectrum and the duplicate entirely. We would like to drop those pins once the dependency direction is restored.

🖥️ Steps to Reproduce

Reproduction: in a project that depends on react-aria-components with ^ ranges on @react-types/{button,checkbox,grid,table}, resolve dependencies and inspect the tree:

npm ls @adobe/react-spectrum   # present (unexpected)
npm ls react-aria              # two versions resolved

Pinning the four packages to their last type-only versions removes @adobe/react-spectrum and collapses back to a single react-aria / react-stately.

Version

Not using @adobe/react-spectrum directly. We consume react-aria / react-aria-components. Relevant resolved versions: - react-aria: 3.49.0 - @react-types/button: 3.16.0 (problematic) / 3.15.1 (last type-only) - @react-types/checkbox: 3.11.0 (problematic) / 3.10.4 (last type-only) - @react-types/table: 3.14.0 (problematic) / 3.13.6 (last type-only) - @react-types/grid: 3.4.0 (problematic) / 3.3.8 (last type-only) - Package manager: pnpm 11.1.2

What browsers are you seeing the problem on?

Other

If other, please specify.

Not browser-specific. This is a dependency-resolution / package-metadata issue and reproduces in any environment.

What operating system are you using?

Not OS-specific (observed on macOS locally and Linux in CI).

🧢 Your Company/Team

No response

🕷 Tracking Issue

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions