react-plotly.js icon indicating copy to clipboard operation
react-plotly.js copied to clipboard

config is cached

Open bishonen opened this issue 5 years ago • 3 comments

When creating a plot and giving it a config, it seems the config is cached/stale. I have added a button in a config which e.g. console.logs redux's state. Even though the state changes throughout using the app, clicking the button yields always the same result.

Any idea if I'm missing something simple here or if I should create some code example for further deep dives?

Thanks!

bishonen avatar Nov 18 '20 00:11 bishonen

I'm having the same problem. After looking at this for a while today I can't see anything I'm doing wrong. I'm passing in a brand new config object on subsequent renders, but the stale click function fires.

Curious if you found any workarounds @bishonen

Edit: For this deadline I'm working around it for now by using key to get react-plotly to create a new component from scratch whenever the callback needs to be updated. Obviously not ideal from a performance standpoint

dougdenn avatar Jan 12 '21 18:01 dougdenn

I have the same problem

quanglam2807 avatar Mar 26 '21 08:03 quanglam2807

config simply gets passed to plotly.js. No caching happens in this library. You might wanna raise an issue in the plotly.js repo to get the right attention.

dmt0 avatar Mar 26 '21 15:03 dmt0