You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[Due for payment 2025-04-02] [$250] [Dev] Console Error: A props object containing a "key" prop is being spread into JSX #58261
Version Number: v9.1.10-3 Develop Reproducible in staging?: Needs Reproduction Reproducible in production?: Needs Reproduction If this was caught on HybridApp, is this reproducible on New Expensify Standalone?: 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:@QichenZhu Slack conversation (hyperlinked to channel name): #Expensify Bugs
Action Performed:
Log in to the development HybridApp on Android or iOS.
Go to the Reports page.
Expected Result:
No console errors on the Reports page.
Actual Result:
Console Error: A props object containing a "key" prop is being spread into JSX.
Workaround:
Unknown
Platforms:
Which of our officially supported platforms is this issue occurring on?
⚠️@Shahidullah-Muffakir Thanks for your proposal. Please update it to follow the proposal template, as proposals are only reviewed if they follow that format (note the mandatory sections).
Please re-state the problem that we are trying to solve in this issue.
We're seeing console errors on the Reports page stating "A props object containing a 'key' prop is being spread into JSX.
What is the root cause of that problem?
The SavedSearchMenuItem type includes a key property. When these menu items are mapped in the PopoverMenu component, all properties including key are spread into the JSX using {...menuItemProps}. React treats key as a special prop that shouldn't be passed to components, which causes the console error.
What changes do you think we should make in order to solve the problem?
We should keep the key property for identification purposes but prevent it from being passed as a prop to React components. There are 4 options:
In SearchTypeMenuPopover.tsx, rename the key property in SavedSearchMenuItem to something like itemKey or searchKey and update all references to use this new name.
typeSavedSearchMenuItem=MenuItemWithLink&{itemKey: string;// Changed from 'key' to 'itemKey'hash: string;query: string;styles?: Array<ViewStyle|TextStyle>;};
Alternatively, we can distructure the Key separately here, so it won't be passed in the props spreading:
Update this:
So we should DRY code and use type from SearchUIUtils.ts only.
What specific scenarios should we cover in automated tests to prevent reintroducing this issue in the future?
This is a typecast error so I think no test is required
What alternative solutions did you explore? (Optional)
NA
Reminder: Please use plain English, be brief and avoid jargon. Feel free to use images, charts or pseudo-code if necessary. Do not post large multi-line diffs or write walls of text. Do not create PRs unless you have been hired for this job.
The solution for this issue has been 🚀 deployed to production 🚀 in version 9.1.18-4 and is now subject to a 7-day regression period 📆. Here is the list of pull requests that resolve this issue:
@dominictb@isabelastisser@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]
[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: NA
[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.
No regression test is needed because this is a dev-only issue.
Activity
melvin-bot commentedon Mar 12, 2025
Triggered auto assignment to @isabelastisser (
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.MelvinBot commentedon Mar 12, 2025
This has been labelled "Needs Reproduction". Follow the steps here: https://stackoverflowteams.com/c/expensify/questions/16989
dominictb commentedon Mar 12, 2025
@isabelastisser I can reproduce this with the following steps:
Precondition: Have saved search items. If you don't, create some.
Please assign this to me as per this Slack thread.
github-actions commentedon Mar 12, 2025
Shahidullah-Muffakir commentedon Mar 12, 2025
Proposal
Please re-state the problem that we are trying to solve in this issue.
We're seeing console errors on the Reports page stating "A props object containing a 'key' prop is being spread into JSX.
What is the root cause of that problem?
The SavedSearchMenuItem type includes a key property. When these menu items are mapped in the PopoverMenu component, all properties including key are spread into the JSX using {...menuItemProps}. React treats key as a special prop that shouldn't be passed to components, which causes the console error.
App/src/components/PopoverMenu.tsx
Line 304 in 80cbd29
App/src/components/Search/SearchPageHeader/SearchTypeMenuPopover.tsx
Lines 32 to 37 in 80cbd29
What changes do you think we should make in order to solve the problem?
We should keep the key property for identification purposes but prevent it from being passed as a prop to React components. There are 4 options:
Update this:
App/src/components/PopoverMenu.tsx
Line 271 in 80cbd29
as:
keyprop is already passed, update this:App/src/components/PopoverMenu.tsx
Line 304 in 80cbd29
to this:
What specific scenarios should we cover in automated tests to prevent reintroducing this issue in the future?
We can write test to ensure the
menuItemPropsdoes not havekeyprop in it, while passing it here:App/src/components/PopoverMenu.tsx
Line 304 in 80cbd29
What alternative solutions did you explore? (Optional)
daledah commentedon Mar 12, 2025
Proposal
Please re-state the problem that we are trying to solve in this issue.
Console Error: A props object containing a "key" prop is being spread into JSX.
What is the root cause of that problem?
SavedSearchMenuItemhas akeyprop:App/src/components/Search/SearchPageHeader/SearchTypeMenuPopover.tsx
Line 33 in 80cbd29
When adding saved search to menu items all props are passed
App/src/components/Search/SearchPageHeader/SearchTypeMenuPopover.tsx
Line 195 in 80cbd29
So when rendering Popover menu the
keyprops is also passedApp/src/components/PopoverMenu.tsx
Line 304 in 80cbd29
What changes do you think we should make in order to solve the problem?
I don't see any use of
keyforSavedSearchMenuItem, so we can simply remove this prop.Additionally, there are two similar
SavedSearchMenuItemdefined:App/src/components/Search/SearchPageHeader/SearchTypeMenuPopover.tsx
Lines 32 to 37 in 80cbd29
App/src/libs/SearchUIUtils.ts
Lines 102 to 107 in 80cbd29
So we should DRY code and use type from
SearchUIUtils.tsonly.What specific scenarios should we cover in automated tests to prevent reintroducing this issue in the future?
This is a typecast error so I think no test is required
What alternative solutions did you explore? (Optional)
NA
Reminder: Please use plain English, be brief and avoid jargon. Feel free to use images, charts or pseudo-code if necessary. Do not post large multi-line diffs or write walls of text. Do not create PRs unless you have been hired for this job.
melvin-bot commentedon Mar 12, 2025
Job added to Upwork: https://www.upwork.com/jobs/~021899899286639282267
33 remaining items
melvin-bot commentedon Mar 26, 2025
Reviewinglabel has been removed, please complete the "BugZero Checklist".melvin-bot commentedon Mar 26, 2025
The solution for this issue has been 🚀 deployed to production 🚀 in version 9.1.18-4 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-04-02. 🎊
For reference, here are some details about the assignees on this issue:
melvin-bot commentedon Mar 26, 2025
@dominictb @isabelastisser @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]
dominictb commentedon Mar 27, 2025
BugZero Checklist:
Bug classification
Source of bug:
Where bug was reported:
Who reported the bug:
[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: Add search input to mobile search page(with fixed performance) #56326 (comment)
[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: NA
[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.
No regression test is needed because this is a dev-only issue.
melvin-bot commentedon Apr 2, 2025
Payment Summary
Upwork Job
BugZero Checklist (@isabelastisser)
isabelastisser commentedon Apr 2, 2025
Payment summary:
Contributor @Shahidullah-Muffakir paid $250 via Upwork https://www.upwork.com/nx/wm/offer/106762783
C+ @dominictb $250 pending in Upwork. https://www.upwork.com/jobs/~021899899286639282267
isabelastisser commentedon Apr 2, 2025
@dominictb what's your Upwork profile?
dominictb commentedon Apr 3, 2025
@isabelastisser My Upwork profile is https://www.upwork.com/freelancers/~01f70bed1934fd35d5. Could you please send an offer? TIA!
melvin-bot commentedon Apr 7, 2025
@dominictb Whoops! This issue is 2 days overdue. Let's get this updated quick!
isabelastisser commentedon Apr 7, 2025
@dominictb, I messaged you in Upwork.