Skip to content

Commit

Permalink
Fix incorrect inner component reference (#6044)
Browse files Browse the repository at this point in the history
The inner component is `EditForm`, not `EditContact`.
  • Loading branch information
tdd authored Jun 9, 2023
1 parent 940e963 commit 9a1e1c6
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/content/learn/you-might-not-need-an-effect.md
Original file line number Diff line number Diff line change
Expand Up @@ -1438,7 +1438,7 @@ It would be nice if there was a way to tell React that when `savedContact.id` is
<Solution>
Split the `EditContact` component in two. Move all the form state into the inner `EditForm` component. Export the outer `EditContact` component, and make it pass `savedContact.id` as the `key` to the inner `EditContact` component. As a result, the inner `EditForm` component resets all of the form state and recreates the DOM whenever you select a different contact.
Split the `EditContact` component in two. Move all the form state into the inner `EditForm` component. Export the outer `EditContact` component, and make it pass `savedContact.id` as the `key` to the inner `EditForm` component. As a result, the inner `EditForm` component resets all of the form state and recreates the DOM whenever you select a different contact.
<Sandpack>
Expand Down

0 comments on commit 9a1e1c6

Please sign in to comment.