Browse Source

[Beta]: fix typo on you-might-not-need-an-effect (#5077)

fix typo on you-might-not-need-an-effect
main
Eugene Dzhumak 2 years ago
committed by GitHub
parent
commit
841d3d1b75
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
  1. 2
      beta/src/content/learn/you-might-not-need-an-effect.md

2
beta/src/content/learn/you-might-not-need-an-effect.md

@ -1262,7 +1262,7 @@ This approach satisfies the requirements too. When you type into the input, only
#### Reset state without Effects {/*reset-state-without-effects*/}
This `EditContact` component receives a contact object with shaped like `{ id, name, email }` as the `savedContact` prop. Try editing the name and email input fields. When you press Save, the contact's button above the form updates to the edited name. When you press Reset, any pending changes in the form are discarded. Play around with this UI to get a feel for it.
This `EditContact` component receives a contact object shaped like `{ id, name, email }` as the `savedContact` prop. Try editing the name and email input fields. When you press Save, the contact's button above the form updates to the edited name. When you press Reset, any pending changes in the form are discarded. Play around with this UI to get a feel for it.
When you select a contact with the buttons at the top, the form resets to reflect that contact's details. This is done with an Effect inside `EditContact.js`. Remove this Effect. Find another way to reset the form when `savedContact.id` changes.

Loading…
Cancel
Save