From 3fd086db4d91466a89a27751bba5990220242cfd Mon Sep 17 00:00:00 2001 From: Palash gupta Date: Fri, 4 Mar 2022 13:05:47 +0530 Subject: [PATCH] dashboard: useCallback is removed --- .../ListOfDashboard/TableComponents/Name.tsx | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/frontend/src/container/ListOfDashboard/TableComponents/Name.tsx b/frontend/src/container/ListOfDashboard/TableComponents/Name.tsx index 451b6d0553..31fea67bc3 100644 --- a/frontend/src/container/ListOfDashboard/TableComponents/Name.tsx +++ b/frontend/src/container/ListOfDashboard/TableComponents/Name.tsx @@ -1,20 +1,18 @@ import { Button } from 'antd'; import ROUTES from 'constants/routes'; -import React, { useCallback } from 'react'; -import { generatePath, useHistory } from 'react-router-dom'; - +import React from 'react'; +import { generatePath } from 'react-router-dom'; +import history from 'lib/history'; import { Data } from '..'; const Name = (name: Data['name'], data: Data): JSX.Element => { - const { push } = useHistory(); - - const onClickHandler = useCallback(() => { - push( + const onClickHandler = () => { + history.push( generatePath(ROUTES.DASHBOARD, { dashboardId: data.id, }), ); - }, [data.id, push]); + }; return (