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.

when performing an update on the content, this does not reflect for the listing

See original GitHub issue

I am updating the content of DraggableFlatList, in the data attribute via redux, but I noticed that when updating in the variable that is defined in the date, it does not update the listing, this only occurs when the drag drop

Example with DraggableFlatList:

com draggableflatlist

code:

<DraggableFlatList
        data={data}
        renderItem={this.renderItem}
        keyExtractor={item => `key-${item.interno}`}
        scrollPercent={5}
        onMoveEnd={({ data }) => this.props.ordenacaoActions.setOrderUnidadesRequest({ data })}
        contentContainerStyle={{ marginHorizontal: metrics.baseMargin }}
        ItemSeparatorComponent={() => <View style={styles.separator} />}
      />

Example without DraggableFlatList and use original FlatList

flatlist

code:

<FlatList
        data={data}
        renderItem={this.renderItem}
        keyExtractor={item => `key-${item.interno}`}
        scrollPercent={5}
        onMoveEnd={({ data }) => this.props.ordenacaoActions.setOrderUnidadesRequest({ data })}
        contentContainerStyle={{ marginHorizontal: metrics.baseMargin }}
        ItemSeparatorComponent={() => <View style={styles.separator} />}
      />

I believe the lib, is not considering in your shouldComponentUpdate when there is update in the input values, or something of the genre …

Am I correct about this procedure?

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Reactions:3
  • Comments:5 (1 by maintainers)

github_iconTop GitHub Comments

2reactions
kelsoniccommented, Aug 12, 2019

I solved this using @bomei’s suggestion. Passing the prop extraData with the nested data that can change resolved the issue for me. Check out the docs on this prop here: https://facebook.github.io/react-native/docs/flatlist#extradata

It might be clearer if we added a link in the readme to all the FlatList props you can pass so we avoid confusion in the future: https://facebook.github.io/react-native/docs/flatlist#props

1reaction
bomeicommented, Dec 19, 2018

FlatList is pureComponent, you should add extraData={data} or something similar in your code.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Update a table of contents - Microsoft Support
Go to References > Update Table. Select one of the following: Update page numbers only This only updates the pages that the headings...
Read more >
WordPress Changes Not Showing? 3 Methods to Fix It Right ...
When WordPress is not showing changes right away, it is most likely still displaying a cached version. Learn three ways to fix this...
Read more >
Why does my GitHub page not update its content?
I reflect my changes in my deployed GitHub repository after committing locally, by renaming my gh-pages branch to master ...
Read more >
WordPress Changes Not Showing? Here's How to Fix ... - Kinsta
Having issues with WordPress changes not showing on your site? It's usually problems with caching - we'll show you how to fix the...
Read more >
Control when app changes are published with managed ...
On the left menu, select Publishing overview. · Check that all your changes have been approved and are listed under “Changes ready to...
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