Skip to content
This repository has been archived by the owner on Oct 1, 2024. It is now read-only.

FormState.List is broken for nested lists #571

Closed
2 tasks done
wrenhawth opened this issue Mar 11, 2019 · 0 comments · Fixed by #900
Closed
2 tasks done

FormState.List is broken for nested lists #571

wrenhawth opened this issue Mar 11, 2019 · 0 comments · Fixed by #900

Comments

@wrenhawth
Copy link

wrenhawth commented Mar 11, 2019

Overview

Related to #519, the recent fix #531 fixed the issue for lists a single level deep. However, if there's a FormState.List within a FormState.List, the component crashes when an item is added to the nested list, because initialValue is undefined instead of an empty array.

I believe adding an additional guard of initialValue || before intialValue[index] to line 49 of List.tsx will solve this issue and it seems to work with local testing, but I do not know the package well enough to thoroughly test for unintended side-effects.

Consuming repo

Shopify/quilt

Checklist

  • Please delete the labels section before submitting your issue
  • I have described this issue in a way that is actionable (if possible)
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