From c63dab44bdd64088a754c9a18bd70df234440ca4 Mon Sep 17 00:00:00 2001 From: Aaron Pennington Date: Fri, 2 Aug 2024 16:06:40 -0600 Subject: [PATCH] Update create-a-custom-react-hook-to-handle-form-fields.md (#763) Quick typo fix --- _chapters/create-a-custom-react-hook-to-handle-form-fields.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/_chapters/create-a-custom-react-hook-to-handle-form-fields.md b/_chapters/create-a-custom-react-hook-to-handle-form-fields.md index 7eaf135f4..6e13e1230 100644 --- a/_chapters/create-a-custom-react-hook-to-handle-form-fields.md +++ b/_chapters/create-a-custom-react-hook-to-handle-form-fields.md @@ -58,7 +58,7 @@ Creating a custom hook is amazingly simple. In fact, we did this back when we cr 2. Our Hook takes the initial state of our form fields as an object and saves it as a state variable called `fields`. The initial state in our case is an object where the _keys_ are the ids of the form fields and the _values_ are what the user enters. -3. So our hook returns an array with `fields` and a callback function that sets the new state based on the event object. The callback function takes the event object and gets the form field id from `event.target.id` and the value from `event.target.value`. In the case of our form the elements, the `event.target.id` comes from the `controlId` that's set in the `Form.Group` element: +3. So our hook returns an array with `fields` and a callback function that sets the new state based on the event object. The callback function takes the event object and gets the form field id from `event.target.id` and the value from `event.target.value`. In the case of our form elements, the `event.target.id` comes from the `controlId` that's set in the `Form.Group` element: ```tsx