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

issue: error in docs #1025

Open
nicitaacom opened this issue Nov 14, 2023 · 0 comments
Open

issue: error in docs #1025

nicitaacom opened this issue Nov 14, 2023 · 0 comments

Comments

@nicitaacom
Copy link

nicitaacom commented Nov 14, 2023

Codesandbox/Expo snack

https://github.com/nicitaacom/acc2-react_hook_form_with_useref

Version Number

7.47.0

Steps to reproduce and reproduce example

I tried do it with codesandbox but got 2 errors
image

It even don't let me type in terminal
image

Expo snack don't let me import respository also there are no terminal at all (I wanted to create clear next app to create minimal reproduce example but since I didn't found it I decided to import repository)
image




Minimal reproduce example

please check it out - https://github.com/nicitaacom/acc2-react_hook_form_with_useref

  1. git clone https://github.com/nicitaacom/acc2-react_hook_form_with_useref
  2. pnpm i
  3. pnpm dev
  4. It should work like so:
    when I press esc it discard changes I made
    when I press enter it apply changes I made

Now to discard changes I use event listener on esc press and it doesn't work (I mean I ref is null - check console log to make sure that is null - so I that's the isse - without ref its no way to realize functionality I described above)

Expected behaviour

https://www.react-hook-form.com/faqs/#Howtosharerefusage

This example lies and firstNameRef returns null if you console.log it

It makes impossibe to use ref to add event listener to ref (or set focus state)

What browsers are you seeing the problem on?

Chrome

Relevant log output

'inputRef.current - ' null
@bluebill1049 bluebill1049 transferred this issue from react-hook-form/react-hook-form Nov 15, 2023
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

1 participant