question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

No clean way to force-update Sticky

See original GitHub issue

I’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:open
  • Created 6 years ago
  • Reactions:5
  • Comments:7 (3 by maintainers)

github_iconTop GitHub Comments

13reactions
callumlockecommented, Mar 23, 2018

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.

0reactions
vcarlcommented, Apr 5, 2019

Good idea! I’m happy to merge a PR if you want to submit one @Simon-Tang 😃

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found