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.

Scrolling triggers render on all child components of StickyContainer

See original GitHub issue

Confirmed by modifying timeline example like so:

    const Lorem = props => {
        console.log("LOREM RENDERED", props);
        return (
            <p>
                Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor
                in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
            </p>
        );
    }

      let timeline = [2000, 2010].map((decade) => {
        return (
          <StickyContainer style={{zIndex: 4}}>
            <Sticky style={{zIndex: 3}}>
              <h2>{decade}s</h2>
            </Sticky>
            { _.range(0,10).map((i) => {
              return (
                <StickyContainer style={{zIndex: 2}}>
                  <Sticky>
                    <h3>{decade + i}</h3>
                  </Sticky>
                  <Lorem />
                  <Lorem />
                </StickyContainer>
              );
            })  }
          </StickyContainer>
        );
      })

This absolute wrecks performance whenever your children are at all complex.

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Comments:12 (9 by maintainers)

github_iconTop GitHub Comments

1reaction
dbarbalatocommented, Jun 1, 2016

5.0.3 is now available on npm

1reaction
dbarbalatocommented, May 19, 2016

Just did a big performance upgrade (special thanks to @phestermcs for the main idea) that should significantly cut the number of redraws required.

Changes are available on npm as 5.0.1 – any feedback would be great, but I’d be equally happy with a closed issue 😃

Read more comments on GitHub >

github_iconTop Results From Across the Web

react-multiple-sticky/container.tsx at master · Dashlane/react ...
React component to implement multiple sticky elements when parent container is scrolling - react-multiple-sticky/container.tsx at master ...
Read more >
react-sticky-h - npm
Sticky component for React. ... Make your React components sticky! ... Only scrolling within the nearest StickyContainer can trigger sticky ...
Read more >
Click link to scroll to specific section react.js - Stack Overflow
I am having trouble understanding how to implement something like react-scroll or scrollchor or react-router link tags to be able to click on ......
Read more >
An Explanation of How the Intersection Observer Watches
The general idea being a way to watch a child element and be informed ... causes the observer to stop watching all of...
Read more >
Tabs - Ant Design
Hide default plus icon, and bind event for customized trigger. ... forceRender, Forced render of content in tabs, not lazy render after clicking...
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