Scrolling triggers render on all child components of StickyContainer
See original GitHub issueConfirmed 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:
- Created 7 years ago
- Comments:12 (9 by maintainers)
Top 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 >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 FreeTop 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
Top GitHub Comments
5.0.3 is now available on npm
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 😃