medium10 pts · first answer countsreactreact-state
Form keeps the previous user data
A ProfileForm keeps its fields in local state. When the user picks a different person in the sidebar, the form still shows what was typed for the previous person. What is the simplest correct fix?
<ProfileForm userId={selectedId} />Discussion 0
Join free to post in the discussion.
Related questions
- Why React lists need keysFrontend Developer
- Input that ignores typingFrontend Developer
- Changing a prop inside a childFrontend Developer
- Multiple setState callsFrontend Developer
- Syncing derived values with an effectFrontend Developer
- Cause of a hydration mismatchFrontend Developer
- Why React.memo did not helpFrontend Developer
- Keys for rows loaded from an APIFull Stack Developer