Skip to content

Conversation

@himaniraghav3
Copy link
Collaborator

Related JIRA Ticket:

https://topcoder.atlassian.net/browse/PM-589

What's in this PR?

Add logic to Show load more button only when there is more data to load

const opportunities = data ? data.flat() : []

return { data: opportunities, isValidating, setSize: (s: number) => { setSize(s) }, size }
const lastPage = data[data.length - 1] || []

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Check if data is not null or undefined before accessing data.length to prevent potential runtime errors.

columns={tableColumns}
data={tableData}
moreToLoad={isValidating || opportunities.length > 0}
moreToLoad={hasMoreOpportunities}

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The variable hasMoreOpportunities should be defined and initialized properly in the component to ensure it accurately reflects whether there are more opportunities to load. Verify that hasMoreOpportunities is correctly set and updated based on the data source.

@kkartunov kkartunov merged commit 150e438 into dev Apr 29, 2025
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants