Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[$250] [Dev] Console Warning: ERROR Warning: A props object containing a “key” prop is being spread into JSX: #49064

Closed
1 of 6 tasks
m-natarajan opened this issue Sep 12, 2024 · 17 comments
Assignees
Labels
Bug Something is broken. Auto assigns a BugZero manager. External Added to denote the issue can be worked on by a contributor Needs Reproduction Reproducible steps needed Reviewing Has a PR in review Weekly KSv2

Comments

@m-natarajan
Copy link

m-natarajan commented Sep 12, 2024

If you haven’t already, check out our contributing guidelines for onboarding and email [email protected] to request to join our Slack channel!


Version Number: 9.0.30-9
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: @c3024
Slack conversation: https://expensify.slack.com/archives/C049HHMV9SM/p1726072795900059?thread_ts=1726072125.690969&cid=C049HHMV9SM

Action Performed:

  1. Logon to ND on iOS App
  2. Go to the self DM page
  3. Track an Expense
  4. Click on Share with accountant in the whisper
  5. Continue with the flow till the merchant page.

Expected Result:

No console warning on the workspace merchant page.

Actual Result:

Console Warning
ERROR Warning: A props object containing a “key” prop is being spread into JSX:
let props = {key: someKey, ref: ..., valueType: ..., name: ..., defaultValue: ..., maxLength: ..., label: ..., accessibilityLabel: ..., role: ..., shouldSetTouchedOnBlurOnly: ..., blurOnSubmit: ..., onSubmitEditing: ..., returnKeyType: ..., inputID: ..., errorText: ..., value: ..., onTouched: ..., onPress: ..., onPressOut: ..., onBlur: ..., onInputChange: ...};
<ForwardRef(TextInput) {...props} />

Workaround:

Unknown

Platforms:

Which of our officially supported platforms is this issue occurring on?

  • Android: Native
  • Android: mWeb Chrome
  • iOS: Native
  • iOS: mWeb Safari
  • MacOS: Chrome / Safari
  • MacOS: Desktop

Screenshots/Videos

Add any screenshot/video evidence

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~021836067438259125444
  • Upwork Job ID: 1836067438259125444
  • Last Price Increase: 2024-09-17
  • Automatic offers:
    • gijoe0295 | Contributor | 104010367
Issue OwnerCurrent Issue Owner: @puneetlath
@m-natarajan m-natarajan added Daily KSv2 Needs Reproduction Reproducible steps needed Bug Something is broken. Auto assigns a BugZero manager. labels Sep 12, 2024
Copy link

melvin-bot bot commented Sep 12, 2024

Triggered auto assignment to @puneetlath (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
Copy link

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

@gijoe0295
Copy link
Contributor

gijoe0295 commented Sep 12, 2024

Edited by proposal-police: This proposal was edited at 2024-09-12 23:05:24 UTC.

Proposal

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

Console Warning: A props object containing a “key” prop is being spread into JSX

What is the root cause of that problem?

This happens in the InputWrapper where we apply spread operator for registerInput which contains key prop:

return <InputComponent {...registerInput(inputID, shouldSubmitForm, {ref, valueType, ...rest, shouldSetTouchedOnBlurOnly, blurOnSubmit})} />;

key: inputProps.key ?? inputID,

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

Separate the key and other props from registerInput:

const {key, ...restProps} = registerInput();
return <InputComponent key={key} {...restProps} />;

Additionally, we might need to double check every places where we use spread operator for component props to ensure they do not spread key. We can leverage the eslint-disable-next-line react/jsx-props-no-spreading lint for this case.

@melvin-bot melvin-bot bot added the Overdue label Sep 16, 2024
@gijoe0295 gijoe0295 mentioned this issue Sep 16, 2024
50 tasks
@puneetlath puneetlath added the External Added to denote the issue can be worked on by a contributor label Sep 17, 2024
@melvin-bot melvin-bot bot changed the title [Dev] Console Warning: ERROR Warning: A props object containing a “key” prop is being spread into JSX: [$250] [Dev] Console Warning: ERROR Warning: A props object containing a “key” prop is being spread into JSX: Sep 17, 2024
Copy link

melvin-bot bot commented Sep 17, 2024

Job added to Upwork: https://www.upwork.com/jobs/~021836067438259125444

@melvin-bot melvin-bot bot added the Help Wanted Apply this label when an issue is open to proposals by contributors label Sep 17, 2024
Copy link

melvin-bot bot commented Sep 17, 2024

Triggered auto assignment to Contributor-plus team member for initial proposal review - @jayeshmangwani (External)

@melvin-bot melvin-bot bot removed the Overdue label Sep 17, 2024
@jayeshmangwani
Copy link
Contributor

@gijoe0295 Is this issue going to be resolved in this PR #49222?

@gijoe0295
Copy link
Contributor

@jayeshmangwani No, this should be handled separately.

@jayeshmangwani
Copy link
Contributor

I agree with @gijoe0295 's Proposal. We should check every spread operator used in the other components too and ensure that the key is passed separately from spread

🎀 👀 🎀 C+ reviewed

Copy link

melvin-bot bot commented Sep 17, 2024

Current assignee @puneetlath is eligible for the choreEngineerContributorManagement assigner, not assigning anyone new.

@melvin-bot melvin-bot bot removed the Help Wanted Apply this label when an issue is open to proposals by contributors label Sep 17, 2024
Copy link

melvin-bot bot commented Sep 17, 2024

📣 @gijoe0295 🎉 An offer has been automatically sent to your Upwork account for the Contributor role 🎉 Thanks for contributing to the Expensify app!

Offer link
Upwork job
Please accept the offer and leave a comment on the Github issue letting us know when we can expect a PR to be ready for review 🧑‍💻
Keep in mind: Code of Conduct | Contributing 📖

@melvin-bot melvin-bot bot added Reviewing Has a PR in review Weekly KSv2 and removed Daily KSv2 labels Sep 18, 2024
@gijoe0295
Copy link
Contributor

@puneetlath PR reach production on Sep 25. Should be ready for payment on Oct 2.

@gijoe0295
Copy link
Contributor

@puneetlath Ready for payment.

@puneetlath
Copy link
Contributor

Sorry for the delay!

Payment summary:

Thanks everyone!

@garrettmknight
Copy link
Contributor

$250 approved for @jayeshmangwani

@gijoe0295
Copy link
Contributor

@garrettmknight @puneetlath Hi I haven't received payments for this yet. My Upwork profile is https://www.upwork.com/freelancers/~0187ef68b8203dabee.

@garrettmknight
Copy link
Contributor

@puneetlath did you pay @gijoe0295 somewhere else?

@puneetlath
Copy link
Contributor

Oh hm, weird. The upwork job shows up as unpaid: https://www.upwork.com/nx/wm/workroom/38445346/overview. It must've been during the time when Upwork was having the payment bug because the contract shows as completed. In any case, I've added the payment as a bonus, so you should have it now @gijoe0295. Sorry about that!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Something is broken. Auto assigns a BugZero manager. External Added to denote the issue can be worked on by a contributor Needs Reproduction Reproducible steps needed Reviewing Has a PR in review Weekly KSv2
Projects
Status: Done
Development

No branches or pull requests

6 participants