HSLdevcom / HSLdevcom/digitransit-ui

Warning: flattenChildren(...): Encountered two children with the same key, ...

Open
#1,518 2 comments 0 reactions 0 assignees View on GitHub

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.
screen shot 2017-04-03 at 15 22 02

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.