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
[HOLD ON #22589] [$1000] DEV: Web- Console Error on Display Name Page #23128
Console error displayed:
Warning: TextInput contains an input of type text with both value and defaultValue props. Input elements must be either controlled or uncontrolled (specify either the value prop, or the defaultValue prop, but not both). Decide between using a controlled or uncontrolled input element and remove one of these props.
Workaround:
Unknown
Platforms:
Which of our officially supported platforms is this issue occurring on?
Android / native
Android / Chrome
iOS / native
iOS / Safari
MacOS / Chrome / Safari
MacOS / Desktop
Version Number: Dev 1.3.42-9 Reproducible in staging?: n/a Reproducible in production?: n/a 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 Notes/Photos/Videos: Any additional supporting documentation
Please re-state the problem that we are trying to solve in this issue.
Getting error for using value and defaultValue props together in TextInput component via Form.js file.
What is the root cause of that problem?
The root cause of the problem is that we are not removing defaultValue prop when cloning the Component in Form.js file.
What changes do you think we should make in order to solve the problem?
Adding defaultValue: undefined to the Form.js file's React.cloneElement function fixes the issue and it doesn't break as we are already initializing the value prop to defaultValue in the Form.js file.
Videoed733e8b-5e8c-42aa-b74b-204a62868fd1.mp4
What alternative solutions did you explore? (Optional)
Activity
melvin-bot commentedon Jul 18, 2023
Triggered auto assignment to @jliexpensify (
Bug), see https://stackoverflow.com/c/expensify/questions/14418 for more details.melvin-bot commentedon Jul 18, 2023
Bug0 Triage Checklist (Main S/O)
Platformsin OP are ✅)jeet-dhandha commentedon Jul 18, 2023
Reproducible.
melvin-bot commentedon Jul 18, 2023
Triggered auto assignment to @danieldoglas (
Engineering), see https://stackoverflow.com/c/expensify/questions/4319 for more details.jliexpensify commentedon Jul 18, 2023
Hi @danieldoglas I don't have a DEV environment, but are you able to reproduce this and let me know? Thanks in advance!
danieldoglas commentedon Jul 18, 2023
@jliexpensify it is reproducible
jeet-dhandha commentedon Jul 18, 2023
Proposal
Please re-state the problem that we are trying to solve in this issue.
valueanddefaultValueprops together in TextInput component viaForm.jsfile.What is the root cause of that problem?
defaultValueprop when cloning the Component inForm.jsfile.What changes do you think we should make in order to solve the problem?
defaultValue: undefinedto theForm.jsfile's React.cloneElement function fixes the issue and it doesn't break as we are already initializing thevalueprop todefaultValuein theForm.jsfile.Video
ed733e8b-5e8c-42aa-b74b-204a62868fd1.mp4
What alternative solutions did you explore? (Optional)
12 remaining items
s77rt commentedon Jul 27, 2023
Still on hold
jliexpensify commentedon Aug 22, 2023
Still on hold
Nikhil-Vats commentedon Aug 22, 2023
The other issue is merged and deployed to prod @jliexpensify so we can close this.
jliexpensify commentedon Aug 22, 2023
Awesome, thank you @Nikhil-Vats ! I'll need to pay out @rayane-djouah a reporting bonus though.
aimane-chnaif commentedon Aug 22, 2023
This issue (same root cause) was first reported in #22169
jliexpensify commentedon Aug 22, 2023
Ah, thank you @aimane-chnaif - you're correct. Unfortunately, you don't qualify for a bonus @rayane-djouah .