Fix useMemo and key prop

This commit is contained in:
Piotr Rogowski 2022-02-07 22:31:26 +01:00
parent ef1b074b41
commit 856ca43c65
No known key found for this signature in database
GPG Key ID: 4A842D702D9C6F8F
1 changed files with 3 additions and 3 deletions

View File

@ -72,7 +72,7 @@ const TopBar = ({ tuneId }: { tuneId: string | null }) => {
const { currentUser, logout } = useAuth();
const navigate = useNavigate();
const { query } = useKBar();
const buildTuneUrl = (route: string) => tuneId ? generatePath(route, { tuneId }) : null;
const buildTuneUrl = useCallback((route: string) => tuneId ? generatePath(route, { tuneId }) : null, [tuneId]);
const rootPathMatch = useMatch(Routes.ROOT);
const tuneRootMatch = useMatch(`${Routes.TUNE_ROOT}/*`);
const tuneTuneMatch = useMatch(`${Routes.TUNE_TUNE}/*`);
@ -165,11 +165,11 @@ const TopBar = ({ tuneId }: { tuneId: string | null }) => {
const list = [];
if (lg) {
list.push('Download');
list.push(<span key="download-text">Download</span>);
}
if (sm) {
list.push(<DownOutlined />);
list.push(<DownOutlined key="download-icon" />);
}
return list.length ? list : null;