grafana / scenes

Build Grafana dashboards directly in your Grafana app plugins.
https://grafana.com/developers/scenes
Apache License 2.0
141 stars 21 forks source link

VizPanel: Adjust forceRender logic #954

Closed kaydelaney closed 1 week ago

kaydelaney commented 1 week ago

Previously when forceRender was called, for example when a change in the VizPanel's dependency config was detected, the VizPanelRenderer component itself would indeed re-render, but its children could potentially be pure components, like the StatPanel component, or they could be wrapped in VizRepeater, which is also pure, causing them not to re-render. These components won't re-render in cases where, for example, the panel contains data links containing template variables, as the field config object itself hasn't changed, just the value at which the variable points. By incrementing the _renderCounter when forceRender is called, panel components are also force to re-render.

📦 Published PR as canary version: 5.23.0--canary.954.11668840775.0
:sparkles: Test out this PR locally via: ```bash npm install @grafana/scenes-react@5.23.0--canary.954.11668840775.0 npm install @grafana/scenes@5.23.0--canary.954.11668840775.0 # or yarn add @grafana/scenes-react@5.23.0--canary.954.11668840775.0 yarn add @grafana/scenes@5.23.0--canary.954.11668840775.0 ```
scenes-repo-bot-access-token[bot] commented 1 week ago

:rocket: PR was released in v5.23.0 :rocket: