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.

Updating `resultsPerPage` prop doesn't update table without external data

See original GitHub issue

If I create a Griddle component that doesn’t use external data, and pass in a value for the resultsPerPage prop, the Griddle component renders as expected with the specified number of results per page. However, if I then update the value of that prop, the number of results per page in the Griddle component doesn’t change. I’ve tried using React.cloneElement to clone the Griddle component every time my container re-renders, but there’s no change. Anyone have a fix or workaround?

Issue Analytics

  • State:open
  • Created 7 years ago
  • Comments:5

github_iconTop GitHub Comments

1reaction
jackgeekcommented, Mar 8, 2017

@giantyellowrobot btw- you can just give a new unique key prop to a component and that will force the component to unmount/remount

1reaction
twolfe2commented, Nov 10, 2016

@giantyellowrobot Instead of unmounting and remounting, I use the custom externalSetPageSize={yourSetPageSizeFunc}when creating my Griddle table. Then whenever the page size is changed yourSetPageSizeFunc(newPageSize) will be called.

Within yourSetPageSizeFunc I make an API call for my data using the newPageSize.

I keep track of the table size in my Redux store and updated that as well.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Component doesn't Update on Props Change - Stack Overflow
So when you rerender and pass in a new defaultValue, that value is ignored. If you need to change the value externally, then...
Read more >
Search: list | YouTube Data API - Google Developers
Returns a collection of search results that match the query parameters specified in the API request. By default, a search result set identifies...
Read more >
Paging through table data | BigQuery - Google Cloud
Shows how to page through the table data and query results using the BigQuery REST API with examples in C#, Java, Go, Python,...
Read more >
Create and update an external data column in a list or library
Learn how to create, update, and refresh an external data column in a list ... have access to the data and that the...
Read more >
AI Search reference - Product Documentation | ServiceNow
These reference topics provide additional information about AI Search installed components, system properties, features, and forms.
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