Closed Skarvion closed 7 months ago
Thanks for opening this issue! A maintainer will review it soon.
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs within the next 7 days.
Bump
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs within the next 7 days.
What version of
million
are you using?2.6.4
Are you using an SSR adapter? If so, which one?
None
What package manager are you using?
npm
What operating system are you using?
Windows
What browser are you using?
Edge, Firefox
Describe the Bug
When I have a state of an array of
Foo
, and display them as a list using<For>
with one of the item has an input value, then the input value does not get re-rendered when the items in the list have changed, even when addingkey
attribute to the item in the loop. Also, I'm still new-ish to React and Million, so please bear with me.Steps to reproduce:
Id
,Name
,Quantity
)Quantity
)<For>
, with the changeable field tied to an input, alongsideonChange
logic that updates the field of an id appropriately.Removing
<For>
and usingmap
seems to fix the issue but that's counter-productive if I want to render a large amount of items and hence me raising this issue. Also for the sake of learning.Further investigation:
I have pasted a StackBlitz link, but I'm not familiar with how to setup million on StackBlitz, so it cannot load properly. Please take a look at
App.tsx
andFooRowItem.tsx
. Please do tweak to make it load properly if you can.What's the expected result?
I expect that when using
<For>
and having the array filtered/sorted, it should able to render the input field with the value associated to the item.Link to Minimal Reproducible Example
https://stackblitz.com/edit/stackblitz-starters-mkghhj?file=src%2FApp.tsx
Participation