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

Nested numeric id causes out of memory error #4034

Open
mrchief opened this issue May 17, 2018 · 4 comments
Open

Nested numeric id causes out of memory error #4034

mrchief opened this issue May 17, 2018 · 4 comments

Comments

@mrchief
Copy link

mrchief commented May 17, 2018

Are you submitting a bug report or a feature request?

bug report

What is the current behavior?

Nested numeric id causes infinite loop probably and browser crashes eventually

Open redux dev tools and try checking a checkbox in the sandbox: https://codesandbox.io/s/k2w897ym83

image

Without dev tools, you can select the unnested ones but it's very sluggish to update the check state.

This is probably related to #2503

What is the expected behavior?

Should not cause out of memory error

What's your environment?

redux-form: ^7.3.0
Chrome: Version 66.0.3359.170 (Official Build) (64-bit)

@mrchief
Copy link
Author

mrchief commented May 17, 2018

I get this after checking the first plain checkbox (without dev tools open)

image

@mrchief
Copy link
Author

mrchief commented May 17, 2018

As a workaround, I'm doing this (prepending with a $ - which is just an arbitrary char. Any alpha char will work too - anything that makes the string non-numeric will work):

<Field name={`$${id}`} ... />

@mrchief
Copy link
Author

mrchief commented May 17, 2018

Surprisingly, passing an empty bag in initialValues also seems to work (doesn't cause the OOM error):

reduxForm({
  form: 'sampleForm',
  initialValues: {
    sample: {}
  }
})

@mrchief
Copy link
Author

mrchief commented May 17, 2018

Surprisingly, passing an empty bag in initialValues also seems to work

While this works while checking/unchecking, it still causes OOM error on form submit. The $ (or non-numeric) workaround is the only way forward for now it seems.

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