Skip to content

[Bug]: use-resize-observer does not support React 19 #19350

@matthewgallo

Description

@matthewgallo

Package

@carbon/react

Browser

Chrome

Package version

1.81.0

React version

19

Description

Reported via @ocornec, teams within Cloud noticed build failures after including his AI chat library components from @carbon/labs. However, they noticed build failures because of version compatibility issues with use-resize-observer since they are using React 19. Even though these are just warnings, it is causing their builds to fail.

@carbon/ibm-products has a useResizeObserver hook that we use internally, I can add this internally as well to @carbon/react and remove use-resize-observer as a dependency in @carbon/react. This overall sounds like a win-win as it will resolve the warnings/build failures for teams and remove a potentially extraneous dependency.

Reproduction/example

https://stackblitz.com/edit/q1yb8s5s?file=package.json

Steps to reproduce

Run npm install from stackblitz provided (thanks @ariellalgilmore for putting the stackblitz together!)

Suggested Severity

Severity 2 = User cannot complete task, and/or no workaround within the user experience of a given component.

Application/PAL

No response

Code of Conduct

Metadata

Metadata

Assignees

No one assigned

    Type

    Projects

    Status

    ✅ Done

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions