From 01d9f918ce2f09e3836c3028c5a267afef4cb878 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?marcin=20miko=C5=82ajczak?= Date: Wed, 22 Jun 2022 12:49:51 +0200 Subject: [PATCH] Remove react-router-scroll-4 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: marcin mikołajczak --- app/soapbox/containers/soapbox.tsx | 31 +++++++++++------------------- package.json | 1 - yarn.lock | 18 +---------------- 3 files changed, 12 insertions(+), 38 deletions(-) diff --git a/app/soapbox/containers/soapbox.tsx b/app/soapbox/containers/soapbox.tsx index b28cdfccd..22c832233 100644 --- a/app/soapbox/containers/soapbox.tsx +++ b/app/soapbox/containers/soapbox.tsx @@ -5,8 +5,6 @@ import React, { useState, useEffect } from 'react'; import { IntlProvider } from 'react-intl'; import { Provider } from 'react-redux'; import { BrowserRouter, Switch, Redirect, Route } from 'react-router-dom'; -// @ts-ignore: it doesn't have types -import { ScrollContext } from 'react-router-scroll-4'; import { loadInstance } from 'soapbox/actions/instance'; import { fetchMe } from 'soapbox/actions/me'; @@ -116,11 +114,6 @@ const SoapboxMount = () => { }); }, []); - // @ts-ignore: I don't actually know what these should be, lol - const shouldUpdateScroll = (prevRouterProps, { location }) => { - return !(location.state?.soapboxModalKey && location.state?.soapboxModalKey !== prevRouterProps?.location?.state?.soapboxModalKey); - }; - /** Whether to display a loading indicator. */ const showLoading = [ me === null, @@ -228,19 +221,17 @@ const SoapboxMount = () => { {helmet} - - <> - {renderBody()} - - - {(Component) => } - - - - {Component => } - - - + <> + {renderBody()} + + + {(Component) => } + + + + {Component => } + + diff --git a/package.json b/package.json index 86787f17c..d169de468 100644 --- a/package.json +++ b/package.json @@ -167,7 +167,6 @@ "react-popper": "^2.3.0", "react-redux": "^7.2.5", "react-router-dom": "^5.3.0", - "react-router-scroll-4": "^1.0.0-beta.2", "react-simple-pull-to-refresh": "^1.3.0", "react-sparklines": "^1.7.0", "react-sticky-box": "^1.0.2", diff --git a/yarn.lock b/yarn.lock index 489906453..57cc2142a 100644 --- a/yarn.lock +++ b/yarn.lock @@ -6659,7 +6659,7 @@ intl@^1.2.5: resolved "https://registry.yarnpkg.com/intl/-/intl-1.2.5.tgz#82244a2190c4e419f8371f5aa34daa3420e2abde" integrity sha1-giRKIZDE5Bn4Nx9ao02qNCDiq94= -invariant@^2.2.2, invariant@^2.2.4: +invariant@^2.2.2: version "2.2.4" resolved "https://registry.yarnpkg.com/invariant/-/invariant-2.2.4.tgz#610f3c92c9359ce1db616e538008d23ff35158e6" integrity sha512-phJfQVBuaJM5raOpJjSfkiD6BpbCE4Ns//LaXl6wGYtUBY83nWS6Rf9tXm2e8VaK60JEjYldbPif/A2B1C2gNA== @@ -9796,14 +9796,6 @@ react-router-dom@^5.3.0: tiny-invariant "^1.0.2" tiny-warning "^1.0.0" -react-router-scroll-4@^1.0.0-beta.2: - version "1.0.0-beta.2" - resolved "https://registry.yarnpkg.com/react-router-scroll-4/-/react-router-scroll-4-1.0.0-beta.2.tgz#d887063ec0f66124aaf450158dd158ff7d3dc279" - integrity sha512-K67Dnm75naSBs/WYc2CDNxqU+eE8iA3I0wSCArgGSHb0xR/7AUcgUEXtCxrQYVTogXvjVK60gmwYvOyRQ6fuBA== - dependencies: - scroll-behavior "^0.9.1" - warning "^3.0.0" - react-router@5.2.1: version "5.2.1" resolved "https://registry.yarnpkg.com/react-router/-/react-router-5.2.1.tgz#4d2e4e9d5ae9425091845b8dbc6d9d276239774d" @@ -10420,14 +10412,6 @@ schema-utils@^4.0.0: ajv-formats "^2.1.1" ajv-keywords "^5.0.0" -scroll-behavior@^0.9.1: - version "0.9.12" - resolved "https://registry.yarnpkg.com/scroll-behavior/-/scroll-behavior-0.9.12.tgz#1c22d273ec4ce6cd4714a443fead50227da9424c" - integrity sha512-18sirtyq1P/VsBX6O/vgw20Np+ngduFXEMO4/NDFXabdOKBL2kjPVUpz1y0+jm99EWwFJafxf5/tCyMeXt9Xyg== - dependencies: - dom-helpers "^3.4.0" - invariant "^2.2.4" - select-hose@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/select-hose/-/select-hose-2.0.0.tgz#625d8658f865af43ec962bfc376a37359a4994ca"