Skip to content

Is it possible to measure another element? #484

@Zloka

Description

@Zloka

Hi, thanks for a very convenient hook!

I was wondering if it is possible to observe some other element? I.e. I have a component, but I would not like to assign the ref to the component I am returning, rather I want this component to observe and take action based on whether or not another component is intersecting the viewport. I figured I would find it e.g. using document.getElementById.

Effectively, I am trying to detect whether or not a toolbar is active, as it has a fixed position at the top of the screen and is overlapping some of my content. Sadly, it's a piece of functionality integrated from a third party, so I don't have much control over it in my React tree/state management.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions