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: fieldState properties are not enumerable #8919

Closed
1 task done
MicaelRodrigues opened this issue Aug 25, 2022 · 0 comments · Fixed by #8920
Closed
1 task done

issue: fieldState properties are not enumerable #8919

MicaelRodrigues opened this issue Aug 25, 2022 · 0 comments · Fixed by #8920

Comments

@MicaelRodrigues
Copy link
Contributor

MicaelRodrigues commented Aug 25, 2022

Version Number

7.34.2

Codesandbox/Expo snack

https://codesandbox.io/s/usecontroller-forked-hjclgx?file=/src/App.js

Steps to reproduce

1 - Invoke useController and destructure fieldState.
2 - Try to copy fieldState using the spread operator {...fieldState}.

This was introduced in #8334 and happens because Object.defineProperties call is not setting properties as enumerable.

Expected behaviour

Being able to "copy" field state using spread operator.

I've dropped a PR just in case.

Code of Conduct

  • I agree to follow this project's Code of Conduct
@MicaelRodrigues MicaelRodrigues changed the title issue: fieldState props are not enumerable issue: fieldState properties are not enumerable Aug 25, 2022
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Oct 25, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant