Skip to content

Feature- Request: Add onStickyChange to <Sticky/> #270

Open
@hepiyellow

Description

@hepiyellow

I'm submitting a ...

  • bug report
  • feature request
  • support request

What is the current behavior?

If I want to lift the isSticky state of a certain <Sticky/> to the parent component, I can't do it.

(setting an ancestor's state within the <Sticky/>'s "children as a function" call yields a React warning (render should not have side-effects)

What is the expected or desired behavior?

Why do you want this? What use case do you have?

My use-case is that when the <Sticky/> gets sticky, I want to render it in some other container (not with position: fixed.

Another use-case could be, styling the <StickyContainer/> (Or another ancestor of the <Sticky/>) differently when the content isSticky=true.

Is there anything else I should know?

I like this lib.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions