Replace react-router-scroll-4 with inlined implementation (#36253)

This commit is contained in:
diondiondion 2025-09-25 14:26:50 +02:00 committed by GitHub
commit d801cf8e59
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
12 changed files with 302 additions and 72 deletions

View file

@ -1,6 +1,7 @@
import type { PropsWithChildren } from 'react';
import type React from 'react';
import type { useLocation } from 'react-router';
import { Router as OriginalRouter, useHistory } from 'react-router';
import type {
@ -18,7 +19,9 @@ interface MastodonLocationState {
mastodonModalKey?: string;
}
type LocationState = MastodonLocationState | null | undefined;
export type LocationState = MastodonLocationState | null | undefined;
export type MastodonLocation = ReturnType<typeof useLocation<LocationState>>;
type HistoryPath = Path | LocationDescriptor<LocationState>;

View file

@ -10,7 +10,7 @@ import { connect } from 'react-redux';
import { supportsPassiveEvents } from 'detect-passive-events';
import { throttle } from 'lodash';
import ScrollContainer from 'mastodon/containers/scroll_container';
import { ScrollContainer } from 'mastodon/containers/scroll_container';
import IntersectionObserverArticleContainer from '../containers/intersection_observer_article_container';
import { attachFullscreenListener, detachFullscreenListener, isFullscreen } from '../features/ui/util/fullscreen';