Feature/update dependency react router dom to v6.x (#340)
* Update dependency "react-router-dom" to v6.x Update to v6.11.2 * Update dependency "react-router-dom" to v6.x - Replace "Switch" with "Routes" * Update dependency "react-router-dom" to v6.x - Relative paths * Update dependency "react-router-dom" to v6.x - Nested routes * Update dependency "react-router-dom" to v6.x - Prevent route warnings - Route without an element causes a warning message. - Routes with non-matching Route causes a warning message. * Update dependency "react-router-dom" to v6.x - Replace "useHistory" with "useNavigate" * Update dependency "react-router-dom" to v6.x - Fix "Link" usage * Update dependency "react-router-dom" to v6.x - Overwrite "useParams" and "useLocations" typing For both functions it's the users fault if they are getting used incorrectly. It's inconvenient to always have to make sure the params exist (useParam) or to cast the return object to a specific type (useLocation) - "useParams": Make generic type non-optional - "useLocation": Add generic type * Update dependency "react-router-dom" to v6.x - Fix use-query-params provider
This commit is contained in:
@@ -15,7 +15,7 @@ import useLocalStorage from 'util/useLocalStorage';
|
||||
import LoadingPlaceholder from 'components/util/LoadingPlaceholder';
|
||||
import { IconButton } from '@mui/material';
|
||||
import TravelExploreIcon from '@mui/icons-material/TravelExplore';
|
||||
import { useHistory } from 'react-router-dom';
|
||||
import { useNavigate } from 'react-router-dom';
|
||||
import { ISource } from 'typings';
|
||||
import { useTranslation } from 'react-i18next';
|
||||
import { translateExtensionLanguage } from 'screens/util/Extensions';
|
||||
@@ -55,7 +55,7 @@ export default function Sources() {
|
||||
|
||||
const { data: sources, isLoading } = requestManager.useGetSourceList();
|
||||
|
||||
const history = useHistory();
|
||||
const navigate = useNavigate();
|
||||
|
||||
useEffect(() => {
|
||||
// make sure all of forcedDefaultLangs() exists in shownLangs
|
||||
@@ -77,7 +77,7 @@ export default function Sources() {
|
||||
setTitle(t('source.title'));
|
||||
setAction(
|
||||
<>
|
||||
<IconButton onClick={() => history.push('/sources/all/search/')} size="large">
|
||||
<IconButton onClick={() => navigate('/sources/all/search/')} size="large">
|
||||
<TravelExploreIcon />
|
||||
</IconButton>
|
||||
<LangSelect
|
||||
|
||||
Reference in New Issue
Block a user