Skip to content

Commit

Permalink
removing some unnecessary memoizations
Browse files Browse the repository at this point in the history
  • Loading branch information
mbondyra committed Feb 19, 2021
1 parent 673019b commit 0b40493
Showing 1 changed file with 4 additions and 16 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -233,7 +233,7 @@ export const InnerWorkspacePanel = React.memo(function InnerWorkspacePanel({
}
}, [suggestionForDraggedField, expressionExists, dispatch]);

const renderEmptyWorkspace = useCallback(() => {
const renderEmptyWorkspace = () => {
return (
<EuiText
className={classNames('lnsWorkspacePanel__emptyContent')}
Expand Down Expand Up @@ -278,9 +278,9 @@ export const InnerWorkspacePanel = React.memo(function InnerWorkspacePanel({
)}
</EuiText>
);
}, [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) {
Expand All @@ -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 (
<WorkspacePanelWrapper
Expand Down

0 comments on commit 0b40493

Please sign in to comment.