You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have a problem with onLayoutComplete :
I'd like to wait for the layout and animations to be complete before showing the items but the event "onLayoutComplete" is triggered before any layout has taken place (I tried with debugger), and is then triggered a lot of times (more times than the number of items I need to display).
Did I miss something ?
I'm also not sure whether the event is supposed to be triggered once all items have been rendered properly or each time an item is render.
Thanks in advance for your help (and many thanks for this lib!!!)!
This is my code (simplified):
export class Masonry extends React.Component<{props}, State> {
//...
public constructor(props) {
super(props);
//...
this.handleLaidOutItems = this.handleLaidOutItems.bind(this);
}
// ... component logic
public handleLaidOutItems(laidOutItems) {
//...
}
public render() {
return (
<InfiniteScroll
pageStart={0}
loadMore={this.renderMoreTweetCards}
hasMore={this.hasMoreItems}
useWindow={false}
initialLoad={false} // Necessary: loads all items if true
threshold={500}
>
<Masonry
className="grid"
options={{
itemSelector: ".grid-item",
transitionDuration: 0,
}}
enableResizableChildren={true}
onLayoutComplete={this.handleLaidOutItems}
>
{children.map( id => {
return <child key={id}/>
})}
</Masonry>
</InfiniteScroll>
);
}
}
The text was updated successfully, but these errors were encountered:
Hello,
I have a problem with onLayoutComplete :
I'd like to wait for the layout and animations to be complete before showing the items but the event "onLayoutComplete" is triggered before any layout has taken place (I tried with debugger), and is then triggered a lot of times (more times than the number of items I need to display).
Did I miss something ?
I'm also not sure whether the event is supposed to be triggered once all items have been rendered properly or each time an item is render.
Thanks in advance for your help (and many thanks for this lib!!!)!
This is my code (simplified):
The text was updated successfully, but these errors were encountered: