Nested field arrays break data.slice
See original GitHub issueDescribe the bug
data.slice is not a function
when removing multiple sub-elements in nested field arrays.
To Reproduce Steps to reproduce the behavior:
- Go to https://codesandbox.io/s/react-hook-form-defaultvalues-4o5iu
- Click on “Add element”
- Click on “add subelement” twice
- Click on “remove subelement” twice
- After the second “remove subelement” the app breaks with
data.slice is not a function
Codesandbox link (Required) https://codesandbox.io/s/react-hook-form-defaultvalues-4o5iu
Expected behavior Sub-elements should be removed without an error.
Additional context If I add another element before removing the second sub-element it works fine. It seems like after removing one nested field array the state is left in a bad state.
Issue Analytics
- State:
- Created 4 years ago
- Reactions:2
- Comments:14 (7 by maintainers)
Top Results From Across the Web
How can i split an array into a nested array by splitting each ...
Here I use functional in PHP to extract data $arrays = [ "Song 1 by ... Then you need split by $row =...
Read more >How do I slice a nested array and how do I update a specific ...
Hi, I have the following data: { _id: "some_id", array1: [ { _id: ... and it will slice each array2 within the respective...
Read more >Spark - How to slice an array and get a subset of elements
slice function takes the first argument as Column of type ArrayType following start of the array index and the number of elements to...
Read more >Nested Arrays in JavaScript - ELATED.com
This tutorial explains how to nest arrays in JavaScript, ... In a nested array, the elements of one array are themselves arrays.
Read more >Work with arrays | BigQuery - Google Cloud
Querying nested arrays. If a table contains an ARRAY of STRUCT s, you can flatten the ARRAY to query the fields of the...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
https://react-hook-form.com/api#useFieldArray
it’s due to
register
not to get invoked insidemap
when using withFormContext
.Thanks for this one, also missed it in the docs but this resolved the issue.