Skip to content

Size props don't update when resize event is used in the child  #43

@aviaryan

Description

@aviaryan

React Sizes won't update the props when a child component is also using the resize event.

Example - A child component of the component that I am using withSizes on has a resize handler defined.

window.addEventListener('resize', this.resize);
// using this.resize to re-render (child) component in case window resizes

When the above is defined, react sizes fails to update the props passed to the parent component.

When I remove the resize handler from the child component and make no other changes, react-sizes works as expected. That's why I think there could be a bug here.

Let me know if you need any more details.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions