diff --git a/src/content/6/en/part6a.md b/src/content/6/en/part6a.md index 8be68fcaff1..eb36ede6eb3 100644 --- a/src/content/6/en/part6a.md +++ b/src/content/6/en/part6a.md @@ -814,10 +814,12 @@ You can read more about uncontrolled forms [here](https://goshakkk.name/controll The method for adding new notes is simple, it just dispatches the action for adding notes: ```js +const inputRef = useRef() + addNote = (event) => { event.preventDefault() - const content = event.target.note.value // highlight-line - event.target.note.value = '' + const content = inputRef.current.value // highlight-line + inputRef.current.value = '' store.dispatch({ type: 'NEW_NOTE', payload: { @@ -833,7 +835,7 @@ We can get the content of the new note straight from the form field. Because the ```js
```