Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for measuring arbitrary nodes as the container #222

Open
bolora opened this issue Jan 31, 2018 · 1 comment
Open

Add support for measuring arbitrary nodes as the container #222

bolora opened this issue Jan 31, 2018 · 1 comment

Comments

@bolora
Copy link

bolora commented Jan 31, 2018

I don't want to use
It would be great if you could assign a selector as wrapper to the Sticky element. Example:

<div id="some-id-that-wraps-sticky-object">
     ...
     <Sticky wrapper="#some-id-that-wraps-sticky-object">
         ...
     </Sticky>

     ...
</div>

Reason:
<div id="some-id-that-wraps-sticky-object"> is outside the react root.
Should also be able to do something like <Sticky wrapper="body">

@vcarl
Copy link
Contributor

vcarl commented Feb 21, 2018

I see your use case, but I'm not a fan of reaching outside of the component arbitrarily. Would something like

<StickyContainer measureNode={domRef}>
  {/* ... */}
</StickyContainer>

work for you? I'm not sure I like that either, but I'd prefer it over an arbitrary selector.

@vcarl vcarl changed the title I don't want to use <StickyContainer> Add support for measuring arbitrary nodes as the container Feb 21, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants