This seems to happen because componentDidUpdate is not called (I think), this happens because we’re mutating the state by using trail.push(value);. To solve this we can either use concat() or something like [...trail, newItem].

Interesting links:

While this seem to improve those errors on first polyline load for small datasets, it just makes it slower for real cases (which always have a lot of data). Maybe its because its creating a new array every time?