From 0d01ff4deab2ec13bc49314747bfb6046e8387ae Mon Sep 17 00:00:00 2001 From: Christophe Porteneuve Date: Wed, 17 May 2023 10:19:24 +0200 Subject: [PATCH] Fix incorrect inner component reference The inner component is `EditForm`, not `EditContact`. --- src/content/learn/you-might-not-need-an-effect.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/content/learn/you-might-not-need-an-effect.md b/src/content/learn/you-might-not-need-an-effect.md index 05f053be264..a3b33d3a76e 100644 --- a/src/content/learn/you-might-not-need-an-effect.md +++ b/src/content/learn/you-might-not-need-an-effect.md @@ -1438,7 +1438,7 @@ It would be nice if there was a way to tell React that when `savedContact.id` is -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.