Map flickers on transition when viewState is stored in Redux
See original GitHub issueDescription
My problem: https://imgur.com/a/haBPnKB
When putting my viewState in Redux - and starting any kind of transition, I get a clear flicker, where the map will start moving, then return back to its starting position, before continuing the movement. I sometimes also get a warning like the one below when this happens:
[Violation] 'requestAnimationFrame' handler took 103ms
If this is some kind of a race condition, it is a very consistent one. The violation for requestAnimationFrame only happens sometimes.
Neither of these problems exist when I store the viewState in a “useState”-hook instead of Redux.
Repro Steps
CodeSandbox: https://codesandbox.io/s/inspiring-cohen-li1zy
- Click the map, and hold the + key for some intense flickering.
Environment (please complete the following information):
- Framework Version: [deck.gl 8.1.3]
- Browser Version: [ Chrome 80.0.3987.149 (Official Build) (64-bit), Chrome 80.0.3987.163 (Official Build) (64-bit) ]
- OS: [Manjaro Linux, Windows 10]
Logs
Whenever the onViewStateChange
-event fires, I log out the current viewState, and the next one like this:
<DeckGL
layers={[]}
viewState={viewState}
controller={MapController}
onViewStateChange={e => {
console.table([viewState, e.viewState])
setViewState(e.viewState)
}}
>
<StaticMap reuseMaps mapStyle={mapStyle} />
</DeckGL>
useState (everything works as expected)
Redux (notice the extra row of output)
Issue Analytics
- State:
- Created 3 years ago
- Comments:16
Top Results From Across the Web
React Page flickers after before it redirects based on redux value
I have a login page, and what I do is I use redux to map state to props to check if the user...
Read more >What happened to Components being just a visual thing?
The freeing of the communication between components seems what React Context, Redux and Recoil are solving. Yes, the former is still in the ......
Read more >Whats so wrong with direct DOM manipulation? : r/javascript
Over the last week I have been experimenting with Vue and React, ... the DOM stuff off so that it can be stored...
Read more >imodeljs-frontend Change Log - iTwin.js
Allow saved map-layer definition to be edited. Removed unused 'maxZoom' property on ... View.load throws if the input is not a valid Id....
Read more >SUc - ALBA.Net
Computer service engineer resume sample, Viewstate error dynamic controls, ... Durham university challenge 2012, Arcadia ca map, Bila af minggu 4, ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Fix is included in
8.5.0-alpha.2
.That’s actually great to know, thank you for digging into it. 8.5.0-alpha rewrote the DeckGL class component with function and hooks. I’ll make sure it works in strict mode.