Skip to content

Commit 4361ee4

Browse files
committed
doc: add update-register usage
1 parent 6686fb7 commit 4361ee4

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,8 @@ This will start an interactive wizard, and then run the specified transform.
3838

3939
Update the `register` API inside a component which use `useForm` of React Hook Form. This transform is not applied if the component doesn't use `useForm`.
4040

41+
npx @hookform/codemod v7/update-register
42+
4143
<details>
4244
<summary>Examples</summary>
4345

transforms/v7/register.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,11 @@ export default function transformer(file: FileInfo, api: API, options) {
99
trailingComma: true
1010
};
1111

12-
// We search for all `import { ... } from "react-hook-form"`
12+
/**
13+
* We search for all react-hook-form's imports
14+
* @example
15+
* import { ... } from "react-hook-form"
16+
* */
1317
const reactHookFormImports = root.find(j.ImportDeclaration, {
1418
source: { value: REACT_HOOK_FORM }
1519
});

0 commit comments

Comments
 (0)