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.

Redux with Remote Data

See original GitHub issue

https://github.com/mbrn/material-table/issues/630 Hi! Kinda same problem as above.

<MaterialTable
  title="Editable Example"
  columns={state.columns}
  data={query => {
    return new Promise((resolve, reject) => {
      queryHandle(query.page, query.pageSize).then(result => {
        resolve({
          data: accountsPage,
          page: page,
          totalCount: total
        })
      })
    })
  }}
 />

This is my table. Function queryHandle dispatches and action that puts accounts into redux.

async accountsParams => {
  try {
    const accounts = await accountApi.get("list", {
     ...accountsParams
    })
    dispatch(getAccountsPageSuccess(accounts, accountsParams))
  } catch (error) {
    dispatch(addError(error))
  }

But

resolve({
  data: accountsPage,
  page: page,
  totalCount: total
})

here we always got “old version” of redux.

In the other case

<MaterialTable
  title="Editable Example"
  columns={state.columns}
  data={accountsPage}
  components={{
    Pagination: () => (
      <TablePagination
        rowsPerPageOptions={[5, 10, 25]}
        count={total}
        rowsPerPage={pageSize}
        page={page}
        onChangePage={handleChangeListPage}
        onChangeRowsPerPage={handleChangeRowsPerPage}
        ActionsComponent={TablePaginationActions}
      />
    )
  }}
/>

in redux I have array of 10 entities (for example), but MT shows only 5 of them. Hope you will help me, thank you ^_^

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:9 (2 by maintainers)

github_iconTop GitHub Comments

2reactions
farajistcommented, Jul 18, 2019

Same issue while trying to update the pageSize dynamically through Redux

2reactions
EVRUSINcommented, Jun 12, 2019

After investigation I realized that in my <MTableBody> in props.renderData I still get only 5 elements, and props.pageSize is still 5

Read more comments on GitHub >

github_iconTop Results From Across the Web

Handle RESTful Requests Data in React/Redux Apps - Medium
The idea is to handle modeling, fetching, and displaying RESTful requests data (Remote data) in React/Redux apps.
Read more >
Redux Essentials, Part 4: Using Redux Data
The official Redux Essentials tutorial: learn how to work with complex Redux state in React components.
Read more >
Redux with Remote Data #630 - mbrn/material-table - GitHub
I'm pulling data into the table using redux. It works seamlessly when I send the data directly without paging, but it does not...
Read more >
Data Management with Redux - Fullstack React
Today, we are going to get back to code and on to adding Redux in our app. The app we're building with it...
Read more >
Is there a way to sync local redux store with remote data?
I am looking to create an application with local redux store. But I want the store to sync frequently with a remote store...
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