You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@superset.apache.org by GitBox <gi...@apache.org> on 2021/10/17 00:37:52 UTC

[GitHub] [superset] michael-s-molina commented on a change in pull request #17115: perf(native-filters): Decrease number of unnecessary rerenders in native filters

michael-s-molina commented on a change in pull request #17115:
URL: https://github.com/apache/superset/pull/17115#discussion_r729810463



##########
File path: superset-frontend/src/dashboard/components/nativeFilters/FilterBar/FilterControls/FilterControls.tsx
##########
@@ -73,25 +72,37 @@ const FilterControls: FC<FilterControlsProps> = ({
   const dashboardHasTabs = useDashboardHasTabs();
   const showCollapsePanel = dashboardHasTabs && cascadeFilters.length > 0;
 
+  const cascadePopoverFactory = useCallback(

Review comment:
       Shouldn't be `useMemo` here? Why are you preserving the instance of the function instead of its result?

##########
File path: superset-frontend/src/dashboard/components/nativeFilters/FilterBar/index.tsx
##########
@@ -274,6 +281,8 @@ const FilterBar: React.FC<FiltersBarProps> = ({
   );
   const isInitialized = useInitialization();
 
+  const tabPaneStyle = useMemo(() => ({ overflow: 'auto', height }), [height]);

Review comment:
       Isn't this overkill? I remembered this [point](https://dmitripavlutin.com/react-usememo-hook/#4-use-memoization-with-care).




-- 
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: notifications-unsubscribe@superset.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org