Skip to content

Commit 9a1e1c6

Browse files
authored
Fix incorrect inner component reference (#6044)
The inner component is `EditForm`, not `EditContact`.
1 parent 940e963 commit 9a1e1c6

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/content/learn/you-might-not-need-an-effect.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -1438,7 +1438,7 @@ It would be nice if there was a way to tell React that when `savedContact.id` is
14381438
14391439
<Solution>
14401440
1441-
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.
1441+
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.
14421442
14431443
<Sandpack>
14441444

0 commit comments

Comments
 (0)