Skip to content

Commit ecbd4b1

Browse files
authored
Merge pull request #8184 from marmelab/doc-linking-two-inputs
[Doc] Fix "Linking two inputs" code snippet
2 parents e0c02f7 + fbea0c9 commit ecbd4b1

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

docs/Inputs.md

+1-3
Original file line numberDiff line numberDiff line change
@@ -395,7 +395,7 @@ const dateParser = value => {
395395

396396
Edition forms often contain linked inputs, e.g. country and city (the choices of the latter depending on the value of the former).
397397

398-
React-admin relies on [react-hook-form](https://react-hook-form.com/) for form handling. You can grab the current form values using react-hook-form [useWatch](https://react-hook-form.com/api/usewatch) hook.
398+
React-admin relies on [react-hook-form](https://react-hook-form.com/) for form handling. You can grab the current form values using react-hook-form's [useWatch](https://react-hook-form.com/api/usewatch) hook.
399399

400400
```jsx
401401
import * as React from 'react';
@@ -412,8 +412,6 @@ const toChoices = items => items.map(item => ({ id: item, name: item }));
412412

413413
const CityInput = props => {
414414
const country = useWatch({ name: 'country' });
415-
const values = getValues();
416-
417415
return (
418416
<SelectInput
419417
choices={country ? toChoices(cities[country]) : []}

0 commit comments

Comments
 (0)