-
Notifications
You must be signed in to change notification settings - Fork 174
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
useArrayFieldItem hook. #366
Comments
I dont follow. Can you create example issue in a code sandbox. |
sorry I wasn't clear. https://codesandbox.io/s/focused-rain-gq0be?file=/src/App.js can you understand the problem from this code sandbox or I should make it more clear? |
I'm making another code sandbox using |
https://codesandbox.io/s/mystifying-feather-g1epx?file=/src/App.js checkout this one. |
I dont think this will work at all... array field is designed to need |
could you explain a bit why does it require all items to be rendered at the same time? |
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. |
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 |
When you look at array fields in a closed room it starts off seeming simple. Then u add the fact that fields are desinged to clean up after themselves on unrender + the concept of relevance where things become irrelevant or relevant depending on other things and the problem complexity goes way up. |
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.
but yeah, this one is a big issue, swapping an item with the one that hasn't been rendered yet :x. |
btw, could you fix the issue of keys getting changed after each re-render? |
Hi, I want to window my form using
react-window
, in order for this to work correctly, there is need to be eitherArrayFieldItem
component oruseArrayFieldItem
hook. so whenreact-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.The text was updated successfully, but these errors were encountered: