kgabryje commented on code in PR #33781:
URL: https://github.com/apache/superset/pull/33781#discussion_r2166223109


##########
superset-frontend/src/dashboard/components/SliceHeader/index.tsx:
##########
@@ -182,6 +183,17 @@ const SliceHeader = forwardRef<HTMLDivElement, 
SliceHeaderProps>(
       ({ dashboardInfo }) => dashboardInfo.crossFiltersEnabled,
     );
 
+    const chart = useSelector<RootState, Chart>(
+      state => state.charts[slice.slice_id],

Review Comment:
   We need the chart object only for the first query response right? If so, can 
we change this selector to `state.charts[id].queriesResponse?.[0]`?
   Selecting the whole chart object will trigger an unnecessary rerender every 
time any field in the chart changes, and we only care about the queries 
response here



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to