Изменение способа открытия модалки выбора создания (#80)

Изменение способа открытия модалки выбора создания
This commit is contained in:
Max Nikitin
2021-02-04 11:49:28 +03:00
committed by GitHub
parent 01087b7f79
commit 38d70b3f39
3 changed files with 20 additions and 13 deletions

View File

@ -5,16 +5,14 @@ import {useHistory} from 'react-router-dom';
type PopupListItemProps = {
item: string;
url: string;
setOpen: (isOpen: boolean) => void;
};
const PopupListItem: React.FC<PopupListItemProps> = ({item, url, setOpen}) => {
const PopupListItem: React.FC<PopupListItemProps> = ({item, url}) => {
const history = useHistory();
const handleClick = useCallback(() => {
setOpen(false);
history.push(url);
}, [history, setOpen, url]);
}, [history, url]);
return (
<ListItem button onClick={handleClick}>