HSLdevcom / HSLdevcom/digitransit-ui
Warning: flattenChildren(...): Encountered two children with the same key, ...
Nobody has claimed this yet.
- Dominant language
- JavaScript
- Stars
- 267
- Forks
- 145
- Avg merge
- 1d 15h
- Merged PRs (30d)
- 75
Description
We get multiple warnings on StopMarkerLayer.js, where the same element is added multiple times. It seems like getStop() is called at least three times without doing anything and always when the map is zoomed/panned.
I know that stops are suppose to added/removed, but could we remove this error by prefixing the component key with a e.g. timestamp?
Warning: flattenChildren(...): Encountered two children with the same key, `RB:NSR.StopPlace.11839`. Child keys must be unique; when two children share a key, only the first child will be used.
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start in StopMarkerLayer.js and trace getStop() while zooming or panning the map. Reproduce the duplicate-key warning, then inspect how repeated stops are added and removed. Done means the warning no longer appears and stop rendering remains correct.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript
- Domain
- frontend
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100