From 95126c176aff0298b73110a420bd58dcf894f586 Mon Sep 17 00:00:00 2001 From: Rushikesh <60548902+RushikeshGandhmal@users.noreply.github.com> Date: Tue, 25 Apr 2023 17:36:52 +0530 Subject: [PATCH 1/2] Issue Updated - Multiple ids with the same value When I click on one input it always points to name field. In the starting structure provided, the id field for all 3 input elements is the same. I guess this is unintentional typo and not a best practice. Please merge it so other people like don't get confuse, great course as always. --- .../src/components/BasicForm.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/code/11-applying-our-hook-and-knowledge/src/components/BasicForm.js b/code/11-applying-our-hook-and-knowledge/src/components/BasicForm.js index 66f627e0b7..80e08cb9a2 100644 --- a/code/11-applying-our-hook-and-knowledge/src/components/BasicForm.js +++ b/code/11-applying-our-hook-and-knowledge/src/components/BasicForm.js @@ -69,10 +69,10 @@ const BasicForm = (props) => { {firstNameHasError &&

Please enter a first name.

}
- + {
- + Date: Tue, 25 Apr 2023 18:44:53 +0530 Subject: [PATCH 2/2] return initialInputState and not inputStateReducer you must return initialInputState and not inputStateReducer --- code/12-finished/src/hooks/use-input.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/code/12-finished/src/hooks/use-input.js b/code/12-finished/src/hooks/use-input.js index db66cc4635..88b447ef2a 100644 --- a/code/12-finished/src/hooks/use-input.js +++ b/code/12-finished/src/hooks/use-input.js @@ -15,7 +15,7 @@ const inputStateReducer = (state, action) => { if (action.type === 'RESET') { return { isTouched: false, value: '' }; } - return inputStateReducer; + return initialInputState; }; const useInput = (validateValue) => {