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

npx @hookform/codemod v7/update-register not working for material ui #13

Open
aubreyzulu opened this issue Mar 24, 2022 · 1 comment
Open

Comments

@aubreyzulu
Copy link

aubreyzulu commented Mar 24, 2022

Describe the bug
A clear and concise description of what the bug is.

The npx @hookform/codemod v7/update-register does not update material UI textfield with
<TextField disabled fullWidth margin="normal" name="name" size="small" type="text" variant="outlined" error={!!errors.name} inputRef={register({ required: true })} />
Only works for
`-

  • <input {...register('example')} />
  • <input {...register('example')} />
  • <input {...register('example')} />
  • <input ref={register({ required: true })} name="example" />
  • <input {...register('example', { required: true })} />
  • <TextInput ref={register({ required: true })} name="example" />
  • <TextInput {...register('example', { required: true })} />`

To Reproduce
Steps to reproduce the behavior

Expected behavior
A clear and concise description of what you expected to happen.

when I run npx @hookform/codemod v7/update-register
it should update matatrial UI textfield input from
<TextField disabled fullWidth margin="normal" name="name" size="small" type="text" variant="outlined" error={!!errors.name} inputRef={register({ required: true })} />
To
<TextField disabled fullWidth margin="normal" size="small" type="text" variant="outlined" error={!!errors.name} {...register("name",{ required: true })} />

Screenshots
If applicable, add screenshots to help explain your problem.

Desktop (please complete the following information):

  • OS: [e.g. MacOs, Linux]
  • Node.js [e.g. 12, 14]

Additional context
Add any other context about the problem here.

@jorisre
Copy link
Member

jorisre commented Mar 25, 2022

Same as #9

Sorry we can't do that

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

No branches or pull requests

2 participants