Use the List component without the automatic fetch

Viewed 172

react admin version : 2.9.5

I would like to use the List component without it automatically making a fetch.

For a special case I would like to fill my redux resource with a "manual" crudGetList in my componentDidMount.

In order to avoid a cache effect: when I first consult my list with a specific id my resource is filled with data and then the List component displays my data.

If I change page then consult the same list with the same resource but with a different id, for a few seconds I will have the first data displayed then after the fecth the redux resource is updated and the good data is displayed

I would like to find a solution to this problem by continuing to use react-admin. Otherwise I'd go by material-ui

Gif exemple]([https://i.ibb.co/KGBVq0T/ezgif-com-video-to-gif.gif

and here my code, StyledCustumTable is the List and DataGrid compenent from react-admin

 <StyledCustomTable
          actions={<PostBulkActionButtons {...rest} />}
          basePath={`campaigns/${campaignId}/lineItems/${campaignId}`}
          bulkActionButtons={<PostBulkActionButtons postActions {...rest} />}
          id="SLM_productsList"
          pagination={<CustomPagination />}
          resource={LINE_ITEM_PRODUCTS}
          {...rest}
        >
          <FunctionField
            label={translate('line_items_status')}
            render={({ globalState }) => (globalState === 'ok' ? <CheckCircleGreen /> : <HighlightOffRed />)}
          />
          <FunctionField
            label={translate('line_items_image')}
            render={({ imageUrl }) => <img alt="" width="70" src={imageUrl} />}
          />
 </StyledCustomTable>

Thank you for your answers

0 Answers
Related