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

Maximum call stack size exceeded when initialValue is an array/object #67

Open
Drogglbecher opened this issue Apr 16, 2020 · 3 comments

Comments

@Drogglbecher
Copy link

Are you submitting a bug report or a feature request?

bug report

What is the current behavior?

Since version 1.0.1 it seems, that values initialized with an empty array leads to a Maximum call stack size exceeded error.

What is the expected behavior?

That I can operate on this array like in version 1.0.0-alpha.1.

Sandbox Link

https://codesandbox.io/s/react-final-form-hooks-simple-example-82tcn?fontsize=14&hidenavigation=1&theme=dark&file=/src/index.js

You can switch between the versions, which should result in the described behaviour. Could it be, that this use case handling arrays and objects should be handled differently now?

@adamklepacz
Copy link

adamklepacz commented May 4, 2020

I'm getting exact same error on my application.
Does anybody know how to fix this?

@rudants
Copy link

rudants commented Jun 8, 2020

@Drogglbecher, @adamklepacz, you can memoize values to avoid re-rendering component.

Link to the working sandbox.: https://codesandbox.io/s/react-final-form-hooks-simple-example-84b9n?file=/src/index.js.

@ayame30
Copy link

ayame30 commented Dec 17, 2020

I faced same issue. The form infinitely re-render if I use array format in initialvalues and validator.
Took a deep look into react-final-form implementation and found they uses useConstant for validation, initialvalues, etc.

https://github.com/search?q=org%3Afinal-form+useConstant&type=code

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

4 participants