Skip to content

[BUG] useResizeObserver complains about assigning null value to HTMLElement #681

@vespaiach

Description

@vespaiach

Describe the bug

I ran into type error when using useResizeObserver hook to observe a div element size

Image

I think useResizeObserver should accept a null value; otherwise, we have to either disable TypeScript checking there or create a dummy div as the initial value for useRef.

To Reproduce

  • Add a useRef hook to component
  • Add useResizeObserver

Expected behavior

useResizeObserver shouldn't complains about null value of ref

Additional context

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions