Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor: useRef in TodoList island #17

Merged
merged 2 commits into from
Mar 27, 2023
Merged

refactor: useRef in TodoList island #17

merged 2 commits into from
Mar 27, 2023

Conversation

iuioiua
Copy link
Contributor

@iuioiua iuioiua commented Mar 27, 2023

Previously, the TodoList island used a signal for reading and writing (resetting to blank) the value of the input element containing the newTodo.name value. The value of this signal was updated every time there was a keystroke in the input.

Now, thanks to useRef, the value of the input is only read and reset upon submission of the form. This required a refactor of the Input component to use forwardRef.

@iuioiua iuioiua marked this pull request as ready for review March 27, 2023 04:22
@iuioiua iuioiua merged commit 439cc07 into main Mar 27, 2023
@iuioiua iuioiua deleted the ref-in-todolist branch March 27, 2023 04:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant