No clean way to force-update Sticky
See original GitHub issueI’ve got a use case wherein I have a <StickyContainer/>
on the right-hand side of the page that expands to the left when the user clicks a button, remaining sticky the whole time. Like this! Since this action doesn’t fire any of the events that <StickyContainer/>
listens for, its left hand side moves to the left but the child <Sticky/>
and its contents don’t until I scroll the page a tick. If I manually trigger an e.g. scroll event on the element I get from context.getParent()
, it updates properly, but it feels hacky. I’d like a param passed from <Sticky/>
to its child render function that I can invoke in order for the layout to update.
Issue Analytics
- State:
- Created 6 years ago
- Reactions:5
- Comments:7 (3 by maintainers)
Top Results From Across the Web
How to Force Update a React Component - Stack Abuse
In this article we'll show you how to force update a component in React.js. More specifically, we'll be giving a brief introduction to...
Read more >How can I force update all the snapshot Gradle dependencies ...
In IntelliJ 2017.2 you can right-click on the project name in the Gradle Tool Window and select Refresh dependencies from the context menu....
Read more >KM4ACK-Pi@groups.io | How to force update clock (date/time) from ...
How to force update clock (date/time) from GPS? ... I said _I_ build images from scratch, and I also tested the install instructions...
Read more >How to Clean MacBook Pro-Air Keyboard [2022 Updated]
Fine dust, crumbs, and sticky mess build-up will all make their way ... As a consequence, you could end up not cleaning up...
Read more >Aging Gracefully: Basic Simulator Maintenance
Know what to use and how to clean your manikin. • Understand basic networking concepts ... Verify that there is not fluid in...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
I want this too.
For now, as a workaround you can do
window.dispatchEvent(new Event('scroll'))
from anywhere, and it tricks the Sticky into re-rendering.Good idea! I’m happy to merge a PR if you want to submit one @Simon-Tang 😃