refactor(deps): update react-router-dom from v6 to 7.10.1 and adapt to breaking changes (#579)

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Anton Tranelis <31516529+antontranelis@users.noreply.github.com>
Co-authored-by: mahula <lenzmath@posteo.de>
This commit is contained in:
dependabot[bot] 2025-12-18 13:01:42 +01:00 committed by GitHub
parent 0c9403f898
commit f099e7893d
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
23 changed files with 89 additions and 71 deletions

View File

@ -21,8 +21,8 @@
"react": "^18.2.0",
"react-dom": "^18.2.0",
"react-rnd": "^10.4.1",
"react-router-dom": "^6.23.0",
"utopia-ui": "^3.0.111",
"react-router-dom": "^7.10.1",
"utopia-ui": "^3.0.112",
"vite-tsconfig-paths": "^5.1.4"
},
"devDependencies": {

View File

@ -1,6 +1,6 @@
{
"name": "utopia-ui",
"version": "3.0.111",
"version": "3.0.112",
"description": "Reuseable React Components to build mapping apps for real life communities and networks",
"repository": "https://github.com/utopia-os/utopia-ui",
"homepage": "https://utopia-os.org/",
@ -96,7 +96,7 @@
"peerDependencies": {
"react": "^18.2.0",
"react-dom": "^18.2.0",
"react-router-dom": "^6.23.0"
"react-router-dom": "^7.10.1"
},
"dependencies": {
"@heroicons/react": "^2.0.17",

View File

@ -45,12 +45,12 @@ export const UserControl = () => {
const handleEdit = () => {
if (!myProfile?.layer) {
navigate(userProfile.id ? `/edit-item/${userProfile.id}` : '#')
void navigate(userProfile.id ? `/edit-item/${userProfile.id}` : '#')
return
}
if (myProfile.layer.itemType.small_form_edit && myProfile.position) {
navigate('/')
void navigate('/')
// Wait for navigation to complete before setting popup
setTimeout(() => {
if (myProfile.position && myProfile.layer) {
@ -65,7 +65,7 @@ export const UserControl = () => {
}
}, 100)
} else {
navigate(userProfile.id ? `/edit-item/${userProfile.id}` : '#')
void navigate(userProfile.id ? `/edit-item/${userProfile.id}` : '#')
}
}
const avatar: string | undefined =

View File

@ -51,9 +51,9 @@ export function LoginPage({ inviteApi, showRequestPassword }: Props) {
invitingProfileId = await redeemInvite(inviteCode)
}
if (invitingProfileId) {
navigate(`/item/${invitingProfileId}`)
void navigate(`/item/${invitingProfileId}`)
} else {
navigate('/')
void navigate('/')
}
}, [navigate, redeemInvite])

View File

@ -20,7 +20,7 @@ export function RequestPasswordPage({ resetUrl }: { resetUrl: string }) {
await toast.promise(requestPasswordReset(email, resetUrl), {
success: {
render() {
navigate('/')
void navigate('/')
return 'Check your mailbox'
},
// other options

View File

@ -22,7 +22,7 @@ export function SetNewPasswordPage() {
await toast.promise(passwordReset(token, password), {
success: {
render() {
navigate('/')
void navigate('/')
return 'New password set'
},
},

View File

@ -25,7 +25,7 @@ export function SignupPage() {
await toast.promise(register({ email, password }, userName), {
success: {
render({ data }) {
navigate('/')
void navigate('/')
return `Hi ${data?.first_name ? data.first_name : 'Traveler'}`
},
// other options

View File

@ -14,7 +14,7 @@ export const GratitudeControl = () => {
<div
className='tw:card-body tw:hover:bg-slate-300 tw:card tw:p-2 tw:h-10 tw:w-10 tw:transition-all tw:duration-300 tw:hover:cursor-pointer'
onClick={() => {
navigate('/select-user')
void navigate('/select-user')
}}
>
<HeartIcon className='tw:stroke-[2.5]' />

View File

@ -195,7 +195,7 @@ export const LocateControl = (): React.JSX.Element => {
}
// Navigate to the profile to show the popup
navigate(`/${result.id}`)
void navigate(`/${result.id}`)
// Clean up and reset state
setFoundLocation(null)

View File

@ -73,11 +73,13 @@ export function EditMenu({
className='tw:text-base-content! tw:tooltip tw:tooltip-top tw:cursor-pointer'
data-tip='Edit'
onClick={(e) => {
item.layer?.customEditLink
? navigate(
`${item.layer.customEditLink}${item.layer.customEditParameter ? `/${item.id}${params.toString() ? '?' + params.toString() : ''}` : ''}`,
)
: editCallback(e)
if (item.layer?.customEditLink) {
void navigate(
`${item.layer.customEditLink}${item.layer.customEditParameter ? `/${item.id}${params.toString() ? '?' + params.toString() : ''}` : ''}`,
)
} else {
editCallback(e)
}
}}
>
<PencilIcon className='tw:h-5 tw:w-5' />

View File

@ -81,7 +81,7 @@ export const ItemViewPopup = forwardRef((props: ItemViewPopupProps, ref: any) =>
setLoading(false)
map.closePopup()
removeItemFromUrl()
navigate('/')
void navigate('/')
}
return (
@ -99,7 +99,7 @@ export const ItemViewPopup = forwardRef((props: ItemViewPopupProps, ref: any) =>
setPositionCallback={() => {
map.closePopup()
setSelectPosition(props.item)
navigate('/')
void navigate('/')
}}
loading={loading}
/>

View File

@ -117,7 +117,7 @@ function useFilterManager(initialTags: Tag[]): {
params.set('layers', visibleNames.join(','))
}
navigate(`${location.pathname}?${params.toString()}`, { replace: true })
void navigate(`${location.pathname}?${params.toString()}`, { replace: true })
}, [visibleLayers, allLayers, navigate])
const [visibleGroupTypes, dispatchGroupTypes] = useReducer(
@ -152,8 +152,8 @@ function useFilterManager(initialTags: Tag[]): {
params.set('tags', `${urlTags || ''}${urlTags ? ';' : ''}${tag.name}`)
}
if (windowDimensions.width < 786 && location.pathname.split('/').length > 2)
navigate('/' + (params ? `?${params}` : ''))
else navigate(location.pathname + (params ? `?${params}` : ''))
void navigate('/' + (params ? `?${params}` : ''))
else void navigate(location.pathname + (params ? `?${params}` : ''))
dispatchTags({
type: 'ADD_TAG',
@ -177,10 +177,10 @@ function useFilterManager(initialTags: Tag[]): {
})
if (newUrlTags !== '') {
params.set('tags', newUrlTags)
navigate(location.pathname + (params ? `?${params}` : ''))
void navigate(location.pathname + (params ? `?${params}` : ''))
} else {
params.delete('tags')
navigate(location.pathname + (params ? `?${params}` : ''))
void navigate(location.pathname + (params ? `?${params}` : ''))
}
dispatchTags({

View File

@ -39,10 +39,10 @@ export function InvitePage({ inviteApi }: Props) {
if (invitingProfileId) {
toast.success('Invite redeemed successfully!')
navigate(`/item/${invitingProfileId}`)
void navigate(`/item/${invitingProfileId}`)
} else {
toast.error('Failed to redeem invite')
navigate('/')
void navigate('/')
}
}
@ -55,7 +55,7 @@ export function InvitePage({ inviteApi }: Props) {
localStorage.setItem('inviteCode', id)
// Redirect to login page
navigate('/login')
void navigate('/login')
}
}, [
id,

View File

@ -187,12 +187,12 @@ export function ProfileView({ attestationApi }: { attestationApi?: ItemsApi<any>
})
}}
editCallback={() => {
navigate('/edit-item/' + item.id)
void navigate('/edit-item/' + item.id)
}}
setPositionCallback={() => {
map.closePopup()
setSelectPosition(item)
navigate('/')
void navigate('/')
}}
big
truncateSubname={false}

View File

@ -133,7 +133,7 @@ export const TabsForm = ({
key={i.id}
className='tw:cursor-pointer tw:card tw:bg-base-200 tw:border-[1px] tw:border-base-300 tw:card-body tw:shadow-xl tw:text-base-content tw:mx-4 tw:p-6 tw:mb-4'
onClick={() => {
navigate('/item/' + i.id)
void navigate('/item/' + i.id)
}}
>
<LinkedItemsHeaderView

View File

@ -286,7 +286,7 @@ export const TabsView = ({
key={i.id}
className='tw:cursor-pointer tw:card tw:bg-base-200 tw:border-[1px] tw:border-base-300 tw:card-body tw:shadow-xl tw:text-base-content tw:p-6 tw:mr-4 tw:mb-4'
onClick={() => {
navigate('/item/' + i.id)
void navigate('/item/' + i.id)
}}
>
<LinkedItemsHeaderView

View File

@ -48,7 +48,7 @@ export function UserSettings() {
},
})
.then(() => {
navigate('/')
void navigate('/')
})
.catch((e) => {
throw e

View File

@ -71,7 +71,7 @@ export const AttestationForm = ({ api }: { api?: ItemsApi<unknown> }) => {
},
)
.then(() => {
navigate(
void navigate(
'/item/' +
// eslint-disable-next-line @typescript-eslint/restrict-plus-operands
items.find(

View File

@ -35,7 +35,7 @@ export const ItemCard = ({
}
if (i.layer.itemType.small_form_edit && i.position) {
navigate('/')
void navigate('/')
// Wait for navigation to complete before setting popup
setTimeout(() => {
if (i.position && i.layer) {
@ -49,7 +49,7 @@ export const ItemCard = ({
}
}, 100)
} else {
navigate('/edit-item/' + i.id)
void navigate('/edit-item/' + i.id)
}
}
@ -60,8 +60,8 @@ export const ItemCard = ({
// We could have an onClick callback instead
const params = new URLSearchParams(window.location.search)
if (windowDimensions.width < 786 && i.position)
navigate('/' + i.id + (params.size > 0 ? `?${params.toString()}` : ''))
else navigate(url + i.id + (params.size > 0 ? `?${params.toString()}` : ''))
void navigate('/' + i.id + (params.size > 0 ? `?${params.toString()}` : ''))
else void navigate(url + i.id + (params.size > 0 ? `?${params.toString()}` : ''))
}}
>
<HeaderView
@ -74,7 +74,7 @@ export const ItemCard = ({
setPositionCallback={() => {
map.closePopup()
setSelectPosition(i)
navigate('/')
void navigate('/')
}}
deleteCallback={() => {
deleteCallback(i)

View File

@ -17,7 +17,7 @@ export function MapOverlayPage({
card?: boolean
}) {
const closeScreen = () => {
navigate(`/${window.location.search ? window.location.search : ''}`)
void navigate(`/${window.location.search ? window.location.search : ''}`)
}
const navigate = useNavigate()

View File

@ -70,7 +70,7 @@ export const MarketView = () => {
{groupAndCount(offers).map((o) => (
<TagView
onClick={() => {
navigate(`/?tags=${o.object.name}`)
void navigate(`/?tags=${o.object.name}`)
}}
key={o.object.id}
tag={o.object}
@ -85,7 +85,7 @@ export const MarketView = () => {
{groupAndCount(needs).map((o) => (
<TagView
onClick={() => {
navigate(`/?tags=${o.object.name}`)
void navigate(`/?tags=${o.object.name}`)
}}
key={o.object.id}
tag={o.object}

View File

@ -39,7 +39,7 @@ export const Tabs: React.FC<TabsProps> = ({ items, setUrlParams }: TabsProps) =>
setUrlParams(params)
const newUrl = location.pathname + '?' + params.toString()
navigate(newUrl, { replace: false })
void navigate(newUrl, { replace: false })
},
[location.pathname, location.search, navigate, setUrlParams],
)

70
package-lock.json generated
View File

@ -22,8 +22,8 @@
"react": "^18.2.0",
"react-dom": "^18.2.0",
"react-rnd": "^10.4.1",
"react-router-dom": "^6.23.0",
"utopia-ui": "^3.0.111",
"react-router-dom": "^7.10.1",
"utopia-ui": "^3.0.112",
"vite-tsconfig-paths": "^5.1.4"
},
"devDependencies": {
@ -139,7 +139,7 @@
},
"lib": {
"name": "utopia-ui",
"version": "3.0.111",
"version": "3.0.112",
"license": "GPL-3.0-only",
"dependencies": {
"@heroicons/react": "^2.0.17",
@ -233,7 +233,7 @@
"peerDependencies": {
"react": "^18.2.0",
"react-dom": "^18.2.0",
"react-router-dom": "^6.23.0"
"react-router-dom": "^7.10.1"
}
},
"lib/node_modules/@typescript-eslint/types": {
@ -3102,15 +3102,6 @@
"integrity": "sha512-42aWfPrimMfDKDi4YegyS7x+/0tlzaqwPQCULLanv3DMIlu96KTJR0fM5isWX2UViOqlGnX6YFgqWepcX+XMNg==",
"license": "MIT"
},
"node_modules/@remix-run/router": {
"version": "1.23.0",
"resolved": "https://registry.npmjs.org/@remix-run/router/-/router-1.23.0.tgz",
"integrity": "sha512-O3rHJzAQKamUz1fvE0Qaw0xSFqsA/yafi2iqeE0pvdFtCO1viYx8QL6f3Ln/aCCTLxs68SLf0KPM9eSeM8yBnA==",
"license": "MIT",
"engines": {
"node": ">=14.0.0"
}
},
"node_modules/@rolldown/pluginutils": {
"version": "1.0.0-beta.27",
"resolved": "https://registry.npmjs.org/@rolldown/pluginutils/-/pluginutils-1.0.0-beta.27.tgz",
@ -6736,6 +6727,19 @@
"dev": true,
"license": "MIT"
},
"node_modules/cookie": {
"version": "1.1.1",
"resolved": "https://registry.npmjs.org/cookie/-/cookie-1.1.1.tgz",
"integrity": "sha512-ei8Aos7ja0weRpFzJnEA9UHJ/7XQmqglbRwnf2ATjcB9Wq874VKH9kfjjirM6UhU2/E5fFYadylyhFldcqSidQ==",
"license": "MIT",
"engines": {
"node": ">=18"
},
"funding": {
"type": "opencollective",
"url": "https://opencollective.com/express"
}
},
"node_modules/core-js-compat": {
"version": "3.47.0",
"resolved": "https://registry.npmjs.org/core-js-compat/-/core-js-compat-3.47.0.tgz",
@ -13609,36 +13613,42 @@
"license": "0BSD"
},
"node_modules/react-router": {
"version": "6.30.1",
"resolved": "https://registry.npmjs.org/react-router/-/react-router-6.30.1.tgz",
"integrity": "sha512-X1m21aEmxGXqENEPG3T6u0Th7g0aS4ZmoNynhbs+Cn+q+QGTLt+d5IQ2bHAXKzKcxGJjxACpVbnYQSCRcfxHlQ==",
"version": "7.10.1",
"resolved": "https://registry.npmjs.org/react-router/-/react-router-7.10.1.tgz",
"integrity": "sha512-gHL89dRa3kwlUYtRQ+m8NmxGI6CgqN+k4XyGjwcFoQwwCWF6xXpOCUlDovkXClS0d0XJN/5q7kc5W3kiFEd0Yw==",
"license": "MIT",
"dependencies": {
"@remix-run/router": "1.23.0"
"cookie": "^1.0.1",
"set-cookie-parser": "^2.6.0"
},
"engines": {
"node": ">=14.0.0"
"node": ">=20.0.0"
},
"peerDependencies": {
"react": ">=16.8"
"react": ">=18",
"react-dom": ">=18"
},
"peerDependenciesMeta": {
"react-dom": {
"optional": true
}
}
},
"node_modules/react-router-dom": {
"version": "6.30.1",
"resolved": "https://registry.npmjs.org/react-router-dom/-/react-router-dom-6.30.1.tgz",
"integrity": "sha512-llKsgOkZdbPU1Eg3zK8lCn+sjD9wMRZZPuzmdWWX5SUs8OFkN5HnFVC0u5KMeMaC9aoancFI/KoLuKPqN+hxHw==",
"version": "7.10.1",
"resolved": "https://registry.npmjs.org/react-router-dom/-/react-router-dom-7.10.1.tgz",
"integrity": "sha512-JNBANI6ChGVjA5bwsUIwJk7LHKmqB4JYnYfzFwyp2t12Izva11elds2jx7Yfoup2zssedntwU0oZ5DEmk5Sdaw==",
"license": "MIT",
"peer": true,
"dependencies": {
"@remix-run/router": "1.23.0",
"react-router": "6.30.1"
"react-router": "7.10.1"
},
"engines": {
"node": ">=14.0.0"
"node": ">=20.0.0"
},
"peerDependencies": {
"react": ">=16.8",
"react-dom": ">=16.8"
"react": ">=18",
"react-dom": ">=18"
}
},
"node_modules/react-toastify": {
@ -14224,6 +14234,12 @@
"randombytes": "^2.1.0"
}
},
"node_modules/set-cookie-parser": {
"version": "2.7.2",
"resolved": "https://registry.npmjs.org/set-cookie-parser/-/set-cookie-parser-2.7.2.tgz",
"integrity": "sha512-oeM1lpU/UvhTxw+g3cIfxXHyJRc/uidd3yK1P242gzHds0udQBYzs3y8j4gCCW+ZJ7ad0yctld8RYO+bdurlvw==",
"license": "MIT"
},
"node_modules/set-function-length": {
"version": "1.2.2",
"resolved": "https://registry.npmjs.org/set-function-length/-/set-function-length-1.2.2.tgz",