From 0b40493f681406bd42a79d67f36d9f4715d63fc7 Mon Sep 17 00:00:00 2001 From: Marta Bondyra Date: Fri, 19 Feb 2021 12:41:19 +0100 Subject: [PATCH] removing some unnecessary memoizations --- .../workspace_panel/workspace_panel.tsx | 20 ++++--------------- 1 file changed, 4 insertions(+), 16 deletions(-) diff --git a/x-pack/plugins/lens/public/editor_frame_service/editor_frame/workspace_panel/workspace_panel.tsx b/x-pack/plugins/lens/public/editor_frame_service/editor_frame/workspace_panel/workspace_panel.tsx index f571c0ad94f849..64f89a60abeeb6 100644 --- a/x-pack/plugins/lens/public/editor_frame_service/editor_frame/workspace_panel/workspace_panel.tsx +++ b/x-pack/plugins/lens/public/editor_frame_service/editor_frame/workspace_panel/workspace_panel.tsx @@ -233,7 +233,7 @@ export const InnerWorkspacePanel = React.memo(function InnerWorkspacePanel({ } }, [suggestionForDraggedField, expressionExists, dispatch]); - const renderEmptyWorkspace = useCallback(() => { + const renderEmptyWorkspace = () => { return ( ); - }, [expressionExists]); + }; - const renderVisualization = useCallback(() => { + const renderVisualization = () => { // we don't want to render the emptyWorkspace on visualizing field from Discover // as it is specific for the drag and drop functionality and can confuse the users if (expression === null && !visualizeTriggerFieldContext) { @@ -298,19 +298,7 @@ export const InnerWorkspacePanel = React.memo(function InnerWorkspacePanel({ ExpressionRendererComponent={ExpressionRendererComponent} /> ); - }, [ - expression, - visualizeTriggerFieldContext, - framePublicAPI, - plugins.data.query.timefilter.timefilter, - dispatch, - onEvent, - setLocalState, - localState, - ExpressionRendererComponent, - configurationValidationError, - renderEmptyWorkspace, - ]); + }; return (