Browse Source

ref(react-router): Normalize react-router/lib/* imports (#28017)

Evan Purkhiser 3 years ago
parent
commit
536793812c

+ 1 - 1
static/app/actionCreators/navigation.tsx

@@ -1,4 +1,4 @@
-import {InjectedRouter} from 'react-router/lib/Router';
+import {InjectedRouter} from 'react-router';
 import {Location} from 'history';
 
 import {openModal} from 'app/actionCreators/modal';

+ 2 - 2
static/app/bootstrap/exportGlobals.tsx

@@ -1,6 +1,6 @@
 import * as React from 'react';
 import ReactDOM from 'react-dom';
-import * as Router from 'react-router';
+import * as ReactRouter from 'react-router';
 import * as Sentry from '@sentry/react';
 import jQuery from 'jquery';
 import moment from 'moment';
@@ -15,9 +15,9 @@ const globals = {
   PropTypes,
   React,
   Reflux,
-  Router,
   Sentry,
   moment,
+  Router: ReactRouter,
   ReactDOM: {
     findDOMNode: ReactDOM.findDOMNode,
     render: ReactDOM.render,

+ 4 - 4
static/app/bootstrap/initializeSdk.tsx

@@ -1,4 +1,4 @@
-import * as Router from 'react-router';
+import * as ReactRouter from 'react-router';
 import {ExtraErrorData} from '@sentry/integrations';
 import * as Sentry from '@sentry/react';
 import SentryRRWeb from '@sentry/rrweb';
@@ -25,9 +25,9 @@ function getSentryIntegrations(hasReplays: boolean = false, routes?: Function) {
       ...(typeof routes === 'function'
         ? {
             routingInstrumentation: Sentry.reactRouterV3Instrumentation(
-              Router.browserHistory as any,
-              Router.createRoutes(routes()),
-              Router.match
+              ReactRouter.browserHistory as any,
+              ReactRouter.createRoutes(routes()),
+              ReactRouter.match
             ),
           }
         : {}),

+ 1 - 2
static/app/components/asyncComponent.tsx

@@ -1,6 +1,5 @@
 import * as React from 'react';
-import {RouteComponentProps} from 'react-router';
-import {WithRouterProps} from 'react-router/lib/withRouter';
+import {RouteComponentProps, WithRouterProps} from 'react-router';
 import * as Sentry from '@sentry/react';
 import isEqual from 'lodash/isEqual';
 import PropTypes from 'prop-types';

+ 1 - 1
static/app/components/charts/chartZoom.tsx

@@ -1,5 +1,5 @@
 import * as React from 'react';
-import {WithRouterProps} from 'react-router/lib/withRouter';
+import {WithRouterProps} from 'react-router';
 import {EChartOption} from 'echarts/lib/echarts';
 import moment from 'moment';
 import * as qs from 'query-string';

+ 1 - 1
static/app/components/charts/eventsChart.tsx

@@ -1,5 +1,5 @@
 import * as React from 'react';
-import {InjectedRouter} from 'react-router/lib/Router';
+import {InjectedRouter} from 'react-router';
 import {withTheme} from '@emotion/react';
 import {EChartOption} from 'echarts/lib/echarts';
 import {Query} from 'history';

+ 1 - 2
static/app/components/charts/releaseSeries.tsx

@@ -1,6 +1,5 @@
 import * as React from 'react';
-import {withRouter} from 'react-router';
-import {WithRouterProps} from 'react-router/lib/withRouter';
+import {withRouter, WithRouterProps} from 'react-router';
 import {withTheme} from '@emotion/react';
 import {EChartOption} from 'echarts/lib/echarts';
 import {Query} from 'history';

+ 1 - 2
static/app/components/events/interfaces/debugMeta-v2/index.tsx

@@ -1,6 +1,5 @@
 import * as React from 'react';
-import {withRouter} from 'react-router';
-import {WithRouterProps} from 'react-router/lib/withRouter';
+import {withRouter, WithRouterProps} from 'react-router';
 import {
   AutoSizer,
   CellMeasurer,

+ 1 - 2
static/app/components/modals/emailVerificationModal.tsx

@@ -1,6 +1,5 @@
 import * as React from 'react';
-import {withRouter} from 'react-router';
-import {WithRouterProps} from 'react-router/lib/withRouter';
+import {withRouter, WithRouterProps} from 'react-router';
 
 import {ModalRenderProps} from 'app/actionCreators/modal';
 import {Client} from 'app/api';

+ 1 - 2
static/app/components/modals/sudoModal.tsx

@@ -1,6 +1,5 @@
 import * as React from 'react';
-import {withRouter} from 'react-router';
-import {WithRouterProps} from 'react-router/lib/withRouter';
+import {withRouter, WithRouterProps} from 'react-router';
 import styled from '@emotion/styled';
 
 import {ModalRenderProps} from 'app/actionCreators/modal';

Some files were not shown because too many files changed in this diff