Skip to content

[Due for payment 2025-06-27] [$250] DEV - Each child in a list should have a unique "key" prop when opening expense reports #63660

Closed

Description

@izarutskaya

If you haven’t already, check out our contributing guidelines for onboarding and email contributors@expensify.com to request to join our Slack channel!


Version Number:
Reproducible in staging?: Needs Reproduction
Reproducible in production?: Needs Reproduction
If this was caught during regression testing, add the test name, ID and link from TestRail:
Email or phone of affected tester (no customers):
Logs: https://stackoverflow.com/c/expensify/questions/4856
Expensify/Expensify Issue URL:
Issue reported by: @dominictb
Slack conversation (hyperlinked to channel name): #expensify_bugs

Action Performed:

  1. Submit two expenses to a workspace
  2. Open the expense report
  3. Observe in console: Each child in a list should have a unique "key" prop error appears

Expected Result:

No error appears

Actual Result:

Console error: Each child in a list should have a unique "key" prop

Workaround:

Unknown

Platforms:

Select the officially supported platforms where the issue was reproduced:

  • Android: App
  • Android: mWeb Chrome
  • iOS: App
  • iOS: mWeb Safari
  • iOS: mWeb Chrome
  • Windows: Chrome
  • MacOS: Chrome
  • MacOS: Desktop
Platforms Tested: On which of our officially supported platforms was this issue tested:
  • Android: App
  • Android: mWeb Chrome
  • iOS: App
  • iOS: mWeb Safari
  • iOS: mWeb Chrome
  • Windows: Chrome
  • MacOS: Chrome
  • MacOS: Desktop

Screenshots/Videos

Screen.Recording.2025-06-06.at.16.22.52.mov

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~021931966855961744185
  • Upwork Job ID: 1931966855961744185
  • Last Price Increase: 2025-06-09
  • Automatic offers:
    • allgandalf | Reviewer | 107616191
    • dominictb | Contributor | 107616193
Issue OwnerCurrent Issue Owner: @
Issue OwnerCurrent Issue Owner: @jliexpensify

Activity

  1. added
    BugSomething is broken. Auto assigns a BugZero manager.
    on Jun 6, 2025
  2. MelvinBot commented on Jun 6, 2025

    @MelvinBot
    Contributor

    This has been labelled "Needs Reproduction". Follow the steps here: https://stackoverflowteams.com/c/expensify/questions/16989

  3. melvin-bot commented on Jun 6, 2025

    @melvin-bot

    Triggered auto assignment to @jliexpensify (Bug), see https://stackoverflow.com/c/expensify/questions/14418 for more details. Please add this bug to a GH project, as outlined in the SO.

  4. izarutskaya commented on Jun 6, 2025

    @izarutskaya
    Author

    From @dominictb

    Proposal

    Please re-state the problem that we are trying to solve in this issue.

    Each child in a list should have a unique "key" prop.

    What is the root cause of that problem?

    In TransactionItemRow, on larger screens (shouldUseNarrowLayout is false), we map all the columns

    {columns?.map((column) => columnComponent[column])}

    But all the columnComponents does not have key prop

    const columnComponent: ColumnComponents = useMemo(

    According to react docs, JSX elements directly inside a map() call always need keys. So the console error is shown.

    What changes do you think we should make in order to solve the problem?

    We should pass a key prop to the column components. We can use CONST.SEARCH.TABLE_COLUMNS as keys. For example with type column:

    [CONST.REPORT.TRANSACTION_LIST.COLUMNS.TYPE]: (
    <View style={[StyleUtils.getReportTableColumnStyles(CONST.SEARCH.TABLE_COLUMNS.TYPE)]}>
    <TypeCell
    transactionItem={transactionItem}
    shouldShowTooltip={shouldShowTooltip}
    shouldUseNarrowLayout={shouldUseNarrowLayout}
    />
    </View>
    ),

                [CONST.REPORT.TRANSACTION_LIST.COLUMNS.TYPE]: (
                    <View key={CONST.SEARCH.TABLE_COLUMNS.TYPE} style={[StyleUtils.getReportTableColumnStyles(CONST.SEARCH.TABLE_COLUMNS.TYPE)]}>
                        <TypeCell
                            transactionItem={transactionItem}
                            shouldShowTooltip={shouldShowTooltip}
                            shouldUseNarrowLayout={shouldUseNarrowLayout}
                        />
                    </View>
                ),

    What specific scenarios should we cover in automated tests to prevent reintroducing this issue in the future?

    None

    What alternative solutions did you explore? (Optional)

    None

  5. allgandalf commented on Jun 6, 2025

    @allgandalf
    Contributor

    I can reproduce this bug by following the steps in the OP, please assign me here as a C+>

    Image

    @jliexpensify please assign me as C+ as per this post: https://expensify.slack.com/archives/C02NK2DQWUX/p1749218091583829

  6. changed the title [-]DEV - Each child in a list should have a unique "key" prop when opening expense reports[/-] [+]DEV - `Each child in a list should have a unique "key" prop` when opening expense reports[/+] on Jun 6, 2025
  7. nyomanjyotisa commented on Jun 6, 2025

    @nyomanjyotisa
    Member

    Proposal

    Please re-state the problem that we are trying to solve in this issue.

    DEV - Each child in a list should have a unique "key" prop when opening expense reports

    What is the root cause of that problem?

    We don't add key prop on all item on columnComponent here

    What changes do you think we should make in order to solve the problem?

    Add key prop using CONST.REPORT.TRANSACTION_LIST.COLUMNS values instead of CONST.SEARCH.TABLE_COLUMNS to all item on columnComponent, basically use the object key itself as the key prop for each <View>

    for example

                [CONST.REPORT.TRANSACTION_LIST.COLUMNS.TYPE]: (
                    <View key={CONST.REPORT.TRANSACTION_LIST.COLUMNS.TYPE} style={[StyleUtils.getReportTableColumnStyles(CONST.SEARCH.TABLE_COLUMNS.TYPE)]}>
                        <TypeCell
                            transactionItem={transactionItem}
                            shouldShowTooltip={shouldShowTooltip}
                            shouldUseNarrowLayout={shouldUseNarrowLayout}
                        />
                    </View>
                ),
    

    What specific scenarios should we cover in automated tests to prevent reintroducing this issue in the future?

    None

    What alternative solutions did you explore? (Optional)

    None

  8. jliexpensify commented on Jun 8, 2025

    @jliexpensify
    Contributor

    @allgandalf is this an External issue or an Internal one?

  9. 25 remaining items

  10. melvin-bot commented on Jun 20, 2025

    @melvin-bot

    Reviewing label has been removed, please complete the "BugZero Checklist".

  11. melvin-bot commented on Jun 20, 2025

    @melvin-bot

    The solution for this issue has been 🚀 deployed to production 🚀 in version 9.1.69-3 and is now subject to a 7-day regression period 📆. Here is the list of pull requests that resolve this issue:

    If no regressions arise, payment will be issued on 2025-06-27. 🎊

    For reference, here are some details about the assignees on this issue:

  12. melvin-bot commented on Jun 20, 2025

    @melvin-bot

    @allgandalf / @dominictb @jliexpensify @allgandalf / @dominictb The PR fixing this issue has been merged! The following checklist (instructions) will need to be completed before the issue can be closed. Please copy/paste the BugZero Checklist from here into a new comment on this GH and complete it. If you have the K2 extension, you can simply click: [this button]

  13. allgandalf commented on Jun 25, 2025

    @allgandalf
    Contributor

    BugZero Checklist:

    • [Contributor] Classify the bug:
    Bug classification

    Source of bug:

    • 1a. Result of the original design (eg. a case wasn't considered)
    • 1b. Mistake during implementation
    • 1c. Backend bug
    • 1z. Other:

    Where bug was reported:

    • 2a. Reported on production (eg. bug slipped through the normal regression and PR testing process on staging)
    • 2b. Reported on staging (eg. found during regression or PR testing)
    • 2d. Reported on a PR
    • 2z. Other: Reported on Dev environment

    Who reported the bug:

    • 3a. Expensify user
    • 3b. Expensify employee
    • 3c. Contributor
    • 3d. QA
    • 3z. Other:
    • [Contributor] The offending PR has been commented on, pointing out the bug it caused and why, so the author and reviewers can learn from the mistake.

      Link to comment: https://github.com/Expensify/App/pull/62286/files#r2165667317

    • [Contributor] If the regression was CRITICAL (e.g. interrupts a core flow) A discussion in #expensify-open-source has been started about whether any other steps should be taken (e.g. updating the PR review checklist) in order to catch this type of bug sooner.

      Link to discussion: N/A

    • [Contributor] If it was decided to create a regression test for the bug, please propose the regression test steps using the template below to ensure the same bug will not reach production again.

    N/A, This was a dev only bug

  14. jliexpensify commented on Jun 25, 2025

    @jliexpensify
    Contributor

    Payment Summary

    https://www.upwork.com/jobs/~021931966855961744185

  15. melvin-bot commented on Jun 30, 2025

    @melvin-bot

    @jliexpensify Uh oh! This issue is overdue by 2 days. Don't forget to update your issues!

  16. melvin-bot commented on Jun 30, 2025

    @melvin-bot

    @jliexpensify Uh oh! This issue is overdue by 2 days. Don't forget to update your issues!

  17. jliexpensify commented on Jun 30, 2025

    @jliexpensify
    Contributor

    Paid and job closed!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

Awaiting PaymentAuto-added when associated PR is deployed to productionBugSomething is broken. Auto assigns a BugZero manager.DailyKSv2ExternalAdded to denote the issue can be worked on by a contributor

Type

No type

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions