Skip to content

Commit 9d5aeda

Browse files
authored
fix(GoBackButton): fixes issue
2 parents 153bf8f + c71a91c commit 9d5aeda

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

react-kit/src/lib/components/buttons/GoBackButton.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,18 @@
11
import React from 'react';
22
import { IconButton, Tooltip } from '@mui/material';
33
import ArrowBackIosIcon from '@mui/icons-material/ArrowBackIos';
4-
import { useNavigate } from 'react-router-dom';
4+
import { NavigateFunction } from 'react-router-dom';
55

66
interface GoBackButtonProps {
77
name?: string;
88
children?: React.ReactNode;
9+
navigate: NavigateFunction;
910
}
1011

1112
export function GoBackButton(props: GoBackButtonProps) {
12-
const navigate = useNavigate();
1313
return (
1414
<Tooltip title="Go Back to Previous Page">
15-
<IconButton name={props.name} color="primary" onClick={() => navigate(-1)}>
15+
<IconButton name={props.name} color="primary" onClick={() => props.navigate(-1)}>
1616
<ArrowBackIosIcon />
1717
{props.children}
1818
</IconButton>

0 commit comments

Comments
 (0)