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.

`Agenda` list Items incorrectly rendering on update

See original GitHub issue

Hello – I think I found a bug in the AgendaList due to the current key extraction.

When I navigate back in the agenda, e.g. from a Monday to Sunday, and if both of those days have arrays of events, the FlatList isn’t rendering the correct item. Instead, an item previously rendered gets used. I’m pretty sure this is because of the string coercion of the indices used in the current key extraction:

https://github.com/wix/react-native-calendars/blob/74bc7fe05ed3883d3d8cbd56e3cd5a565543c385/src/agenda/reservation-list/index.tsx#L261:

  keyExtractor = (_item: DayAgenda, index: number) => String(index);

this seems to me like a pretty good example of the index-key anti pattern described here: https://robinpokorny.medium.com/index-as-a-key-is-an-anti-pattern-e0349aece318

This seems straightforward to fix, by at least exposing a keyExtractor prop to the AgendaList.

I’ll put together a minimal reproduction of this when I get the time.

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Reactions:2
  • Comments:15

github_iconTop GitHub Comments

1reaction
stale[bot]commented, Nov 19, 2022

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

0reactions
Inbal-Tishcommented, Aug 18, 2022

@minaairsupport Hi. Care to submit a PR on this?

Read more comments on GitHub >

github_iconTop Results From Across the Web

ReactNative Agenda not rendering any items - Stack Overflow
I am using the Agenda from wix/react-native-calendars in my code. The problem is its not showing any items the way its intended to...
Read more >
When does React re-render components? - Felix Gerschau
React is known for providing a fast user experience by only updating the parts of the UI that have changed. When looking into...
Read more >
Metaverse beyond the hype: Multidisciplinary perspectives on ...
The paper concludes by proposing a future research agenda that is valuable ... it is necessary to recognize and render scenes and objects....
Read more >
OnBase Troubleshooting Common Issues
In the Web Client, click on the Document dropdown arrow and choose “User”. Then, click the dropdown arrow next to “Mailbox” and click...
Read more >
Known issues with Outlook Desktop Shared Calendar ...
This article discusses issues after you enable Shared Calendar Improvements as detailed here: Outlook calendar sharing updates.
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