Skip to content

useInfiniteQuery jumps to bottom after fetchMore is executed #1170

Discussion options

You must be logged in to vote

Apparently, changing the last part of my code from

{ 
    canFetchMore && 
       <button onClick={() => fetchMore()}>
            FETCH MORE
       </button>
}

to

{ 
       isFetchingMore ? (
                <div className="ellipse-wrapper">
                    <div class="lds-ellipsis">
                        <div></div>
                        <div></div>
                        <div></div>
                        <div></div>
                    </div>
                </div>
       ) :canFetchMore ? ( 
                <button onClick={() => fetchMore()}>
                    FETCH MORE
                </button>
       ) : ' '
}

fixed the issue. I hope that's a valid fix? 🙂

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@tannerlinsley
Comment options

Answer selected by idenyigabriel
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants