Comparison
List keyvsRoute parameter
List key
you delete the second row and the text you had typed into the third row is suddenly in the second.
The stable identifier that tells reconciliation which item in a list is which across renders. Without it, or with the array index used as one, the framework matches items by position, so inserting or removing anything makes state, focus and animations attach to the wrong rows. The fix is always the same and always cheap: use the identifier the data already has.
Full entry →Route parameter
you navigated from one profile to another and the component kept the previous user's data on screen.
A variable segment of a path that identifies which record a route is showing. The trap is that navigating between two values of the same route reuses the component rather than remounting it, so anything initialised on mount does not re-run. Either key the component on the parameter or treat the parameter as a dependency everywhere it is read.
Full entry →