question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

useArrayFieldItem hook.

See original GitHub issue

Hi, I want to window my form using react-window, in order for this to work correctly, there is need to be either ArrayFieldItem component or useArrayFieldItem hook. so when react-window wants to render the rows. I will give that component as a row.

right now, there is the ArrayField.Items which maps the values by itself.

Issue Analytics

  • State:open
  • Created 2 years ago
  • Comments:11 (11 by maintainers)

github_iconTop GitHub Comments

1reaction
Bezmehrabicommented, Dec 18, 2021

btw, could you fix the issue of keys getting changed after each re-render?

0reactions
Bezmehrabicommented, Dec 18, 2021

Also for various reasons. Initial values will NOT populate “values” until the field its associated with is rendered onto screen. This means if u rendered an array field with 100 items and never scrolled to 100. The values would never see half the items

this one really isn’t much of an issue, when the item is not rendered at all, that means the value hasn’t been changed.

Because things like delete and swap depend on it ( especially delete ). If u delete array[9] then array[90] becomes array[89]. Array fields are the most complex thing in this library. It would take complete redesign of how they work to support not rendering all at the same time.

but yeah, this one is a big issue, swapping an item with the one that hasn’t been rendered yet :x.

Read more comments on GitHub >

github_iconTop Results From Across the Web

useFieldArray - Simple React forms validation
Custom hook for working with Field Arrays (dynamic form). The motivation is to provide better user experience and performance. You can watch this...
Read more >
useArrayField nested with separate files #2283 - GitHub
im trying to receive default values in props and iterate it on useEffect like this: useEffect(() => { props.defaultValues.forEach(item => { ...
Read more >
React Hook Form - useFieldArray - CodeSandbox
A custom hook for working with Field Arrays (dynamic inputs). hooks. fieldarray. react.
Read more >
Editing single item in useFieldArray - react hook form
I've run across an issue where I have a list of items (let's say in the left column), then when you click on...
Read more >
React Hook Form 7 - Dynamic Form Example with useFieldArray
The useForm() hook function returns an object with methods and props for working with a form including registering inputs, handling form ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found