Fix misuse of react-router and react-router-dom (#50120)
This commit is contained in:
parent
3a8e65a816
commit
4feb783413
|
@ -32,6 +32,10 @@ module.exports = {
|
||||||
from: 'x-pack',
|
from: 'x-pack',
|
||||||
toRelative: 'x-pack',
|
toRelative: 'x-pack',
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
from: 'react-router',
|
||||||
|
to: 'react-router-dom',
|
||||||
|
},
|
||||||
],
|
],
|
||||||
],
|
],
|
||||||
}
|
}
|
||||||
|
|
|
@ -20,9 +20,7 @@
|
||||||
import PropTypes from 'prop-types';
|
import PropTypes from 'prop-types';
|
||||||
import React, { Component } from 'react';
|
import React, { Component } from 'react';
|
||||||
|
|
||||||
import {
|
import { Link } from 'react-router'; // eslint-disable-line
|
||||||
Link,
|
|
||||||
} from 'react-router';
|
|
||||||
|
|
||||||
import classNames from 'classnames';
|
import classNames from 'classnames';
|
||||||
|
|
||||||
|
|
|
@ -24,10 +24,7 @@ import 'regenerator-runtime/runtime';
|
||||||
import React from 'react';
|
import React from 'react';
|
||||||
import ReactDOM from 'react-dom';
|
import ReactDOM from 'react-dom';
|
||||||
import { Provider } from 'react-redux';
|
import { Provider } from 'react-redux';
|
||||||
import {
|
import { Router, hashHistory } from 'react-router'; // eslint-disable-line
|
||||||
Router,
|
|
||||||
hashHistory,
|
|
||||||
} from 'react-router';
|
|
||||||
|
|
||||||
// Store.
|
// Store.
|
||||||
import configureStore from './store/configure_store';
|
import configureStore from './store/configure_store';
|
||||||
|
|
|
@ -23,11 +23,8 @@ import {
|
||||||
compose,
|
compose,
|
||||||
} from 'redux';
|
} from 'redux';
|
||||||
import thunk from 'redux-thunk';
|
import thunk from 'redux-thunk';
|
||||||
import { browserHistory } from 'react-router';
|
import { browserHistory } from 'react-router'; // eslint-disable-line
|
||||||
import {
|
import { routerMiddleware, routerReducer } from 'react-router-redux';
|
||||||
routerMiddleware,
|
|
||||||
routerReducer,
|
|
||||||
} from 'react-router-redux';
|
|
||||||
|
|
||||||
import codeViewerReducer from './reducers/code_viewer_reducer';
|
import codeViewerReducer from './reducers/code_viewer_reducer';
|
||||||
import sandboxReducer from './reducers/sandbox_reducer';
|
import sandboxReducer from './reducers/sandbox_reducer';
|
||||||
|
|
|
@ -19,9 +19,7 @@
|
||||||
|
|
||||||
import React from 'react';
|
import React from 'react';
|
||||||
|
|
||||||
import {
|
import { Link } from 'react-router'; // eslint-disable-line
|
||||||
Link,
|
|
||||||
} from 'react-router';
|
|
||||||
|
|
||||||
export const NotFoundView = () => (
|
export const NotFoundView = () => (
|
||||||
<div className="guideContentPage">
|
<div className="guideContentPage">
|
||||||
|
|
|
@ -60,7 +60,6 @@
|
||||||
"react-dom": "^16.2.0",
|
"react-dom": "^16.2.0",
|
||||||
"react-redux": "^5.0.6",
|
"react-redux": "^5.0.6",
|
||||||
"react-router": "^3.2.0",
|
"react-router": "^3.2.0",
|
||||||
"react-router-dom": "4.2.2",
|
|
||||||
"react-router-redux": "^4.0.8",
|
"react-router-redux": "^4.0.8",
|
||||||
"redux": "3.7.2",
|
"redux": "3.7.2",
|
||||||
"redux-thunk": "2.2.0",
|
"redux-thunk": "2.2.0",
|
||||||
|
|
|
@ -4,7 +4,7 @@
|
||||||
* you may not use this file except in compliance with the Elastic License.
|
* you may not use this file except in compliance with the Elastic License.
|
||||||
*/
|
*/
|
||||||
import React, { Component } from 'react';
|
import React, { Component } from 'react';
|
||||||
import { RouteProps } from 'react-router';
|
import { RouteProps } from 'react-router-dom';
|
||||||
import { BASE_PATH } from '../../../../common/constants';
|
import { BASE_PATH } from '../../../../common/constants';
|
||||||
import { BreadcrumbConsumer } from './consumer';
|
import { BreadcrumbConsumer } from './consumer';
|
||||||
import { Breadcrumb as BreadcrumbData, BreadcrumbContext } from './types';
|
import { Breadcrumb as BreadcrumbData, BreadcrumbContext } from './types';
|
||||||
|
|
|
@ -3,7 +3,7 @@
|
||||||
* or more contributor license agreements. Licensed under the Elastic License;
|
* or more contributor license agreements. Licensed under the Elastic License;
|
||||||
* you may not use this file except in compliance with the Elastic License.
|
* you may not use this file except in compliance with the Elastic License.
|
||||||
*/
|
*/
|
||||||
import { RouteComponentProps } from 'react-router';
|
import { RouteComponentProps } from 'react-router-dom';
|
||||||
import { BeatsContainer } from './containers/beats';
|
import { BeatsContainer } from './containers/beats';
|
||||||
import { TagsContainer } from './containers/tags';
|
import { TagsContainer } from './containers/tags';
|
||||||
import { URLStateProps } from './containers/with_url_state';
|
import { URLStateProps } from './containers/with_url_state';
|
||||||
|
|
|
@ -8,7 +8,7 @@ import { Location } from 'history';
|
||||||
import omit from 'lodash/fp/omit';
|
import omit from 'lodash/fp/omit';
|
||||||
import { parse as parseQueryString, stringify as stringifyQueryString } from 'querystring';
|
import { parse as parseQueryString, stringify as stringifyQueryString } from 'querystring';
|
||||||
import React from 'react';
|
import React from 'react';
|
||||||
import { RouteComponentProps, withRouter } from 'react-router';
|
import { RouteComponentProps, withRouter } from 'react-router-dom';
|
||||||
// eslint-disable-next-line @typescript-eslint/camelcase
|
// eslint-disable-next-line @typescript-eslint/camelcase
|
||||||
import { decode_object, encode_object } from 'rison-node';
|
import { decode_object, encode_object } from 'rison-node';
|
||||||
import { Omit } from '../lib/lib';
|
import { Omit } from '../lib/lib';
|
||||||
|
|
|
@ -5,7 +5,7 @@
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import React from 'react';
|
import React from 'react';
|
||||||
import { RouteComponentProps } from 'react-router';
|
import { RouteComponentProps } from 'react-router-dom';
|
||||||
import { RedirectWrapper } from './redirect_wrapper';
|
import { RedirectWrapper } from './redirect_wrapper';
|
||||||
import { SiemPageName } from '../../pages/home/types';
|
import { SiemPageName } from '../../pages/home/types';
|
||||||
|
|
||||||
|
|
|
@ -5,7 +5,7 @@
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import React from 'react';
|
import React from 'react';
|
||||||
import { RouteComponentProps } from 'react-router';
|
import { RouteComponentProps } from 'react-router-dom';
|
||||||
import { RedirectWrapper } from './redirect_wrapper';
|
import { RedirectWrapper } from './redirect_wrapper';
|
||||||
import { SiemPageName } from '../../pages/home/types';
|
import { SiemPageName } from '../../pages/home/types';
|
||||||
|
|
||||||
|
|
|
@ -8,7 +8,7 @@ import { mountWithIntl } from 'test_utils/enzyme_helpers';
|
||||||
import DateMath from '@elastic/datemath';
|
import DateMath from '@elastic/datemath';
|
||||||
import React, { useState, Fragment } from 'react';
|
import React, { useState, Fragment } from 'react';
|
||||||
import { useUrlParams, UptimeUrlParamsHook } from '../use_url_params';
|
import { useUrlParams, UptimeUrlParamsHook } from '../use_url_params';
|
||||||
import { RouteComponentProps } from 'react-router';
|
import { RouteComponentProps } from 'react-router-dom';
|
||||||
import { UptimeRefreshContext } from '../../contexts';
|
import { UptimeRefreshContext } from '../../contexts';
|
||||||
|
|
||||||
interface MockUrlParamsComponentProps {
|
interface MockUrlParamsComponentProps {
|
||||||
|
|
30
yarn.lock
30
yarn.lock
|
@ -14679,11 +14679,6 @@ hoek@6.x.x:
|
||||||
resolved "https://registry.yarnpkg.com/hoek/-/hoek-6.0.3.tgz#7884360426d927865a0a1251fc9c59313af5b798"
|
resolved "https://registry.yarnpkg.com/hoek/-/hoek-6.0.3.tgz#7884360426d927865a0a1251fc9c59313af5b798"
|
||||||
integrity sha512-TU6RyZ/XaQCTWRLrdqZZtZqwxUVr6PDMfi6MlWNURZ7A6czanQqX4pFE1mdOUQR9FdPCsZ0UzL8jI/izZ+eBSQ==
|
integrity sha512-TU6RyZ/XaQCTWRLrdqZZtZqwxUVr6PDMfi6MlWNURZ7A6czanQqX4pFE1mdOUQR9FdPCsZ0UzL8jI/izZ+eBSQ==
|
||||||
|
|
||||||
hoist-non-react-statics@^2.3.0:
|
|
||||||
version "2.5.0"
|
|
||||||
resolved "https://registry.yarnpkg.com/hoist-non-react-statics/-/hoist-non-react-statics-2.5.0.tgz#d2ca2dfc19c5a91c5a6615ce8e564ef0347e2a40"
|
|
||||||
integrity sha512-6Bl6XsDT1ntE0lHbIhr4Kp2PGcleGZ66qu5Jqk8lc0Xc/IeG6gVLmwUGs/K0Us+L8VWoKgj0uWdPMataOsm31w==
|
|
||||||
|
|
||||||
hoist-non-react-statics@^2.3.1, hoist-non-react-statics@^2.5.0, hoist-non-react-statics@^2.5.5:
|
hoist-non-react-statics@^2.3.1, hoist-non-react-statics@^2.5.0, hoist-non-react-statics@^2.5.5:
|
||||||
version "2.5.5"
|
version "2.5.5"
|
||||||
resolved "https://registry.yarnpkg.com/hoist-non-react-statics/-/hoist-non-react-statics-2.5.5.tgz#c5903cf409c0dfd908f388e619d86b9c1174cb47"
|
resolved "https://registry.yarnpkg.com/hoist-non-react-statics/-/hoist-non-react-statics-2.5.5.tgz#c5903cf409c0dfd908f388e619d86b9c1174cb47"
|
||||||
|
@ -23061,18 +23056,6 @@ react-reverse-portal@^1.0.4:
|
||||||
resolved "https://registry.yarnpkg.com/react-reverse-portal/-/react-reverse-portal-1.0.4.tgz#d127d2c9147549b25c4959aba1802eca4b144cd4"
|
resolved "https://registry.yarnpkg.com/react-reverse-portal/-/react-reverse-portal-1.0.4.tgz#d127d2c9147549b25c4959aba1802eca4b144cd4"
|
||||||
integrity sha512-WESex/wSjxHwdG7M0uwPNkdQXaLauXNHi4INQiRybmFIXVzAqgf/Ak2OzJ4MLf4UuCD/IzEwJOkML2SxnnontA==
|
integrity sha512-WESex/wSjxHwdG7M0uwPNkdQXaLauXNHi4INQiRybmFIXVzAqgf/Ak2OzJ4MLf4UuCD/IzEwJOkML2SxnnontA==
|
||||||
|
|
||||||
react-router-dom@4.2.2:
|
|
||||||
version "4.2.2"
|
|
||||||
resolved "https://registry.yarnpkg.com/react-router-dom/-/react-router-dom-4.2.2.tgz#c8a81df3adc58bba8a76782e946cbd4eae649b8d"
|
|
||||||
integrity sha512-cHMFC1ZoLDfEaMFoKTjN7fry/oczMgRt5BKfMAkTu5zEuJvUiPp1J8d0eXSVTnBh6pxlbdqDhozunOOLtmKfPA==
|
|
||||||
dependencies:
|
|
||||||
history "^4.7.2"
|
|
||||||
invariant "^2.2.2"
|
|
||||||
loose-envify "^1.3.1"
|
|
||||||
prop-types "^15.5.4"
|
|
||||||
react-router "^4.2.0"
|
|
||||||
warning "^3.0.0"
|
|
||||||
|
|
||||||
react-router-dom@^4.3.1:
|
react-router-dom@^4.3.1:
|
||||||
version "4.3.1"
|
version "4.3.1"
|
||||||
resolved "https://registry.yarnpkg.com/react-router-dom/-/react-router-dom-4.3.1.tgz#4c2619fc24c4fa87c9fd18f4fb4a43fe63fbd5c6"
|
resolved "https://registry.yarnpkg.com/react-router-dom/-/react-router-dom-4.3.1.tgz#4c2619fc24c4fa87c9fd18f4fb4a43fe63fbd5c6"
|
||||||
|
@ -23103,19 +23086,6 @@ react-router@^3.2.0:
|
||||||
prop-types "^15.5.6"
|
prop-types "^15.5.6"
|
||||||
warning "^3.0.0"
|
warning "^3.0.0"
|
||||||
|
|
||||||
react-router@^4.2.0:
|
|
||||||
version "4.2.0"
|
|
||||||
resolved "https://registry.yarnpkg.com/react-router/-/react-router-4.2.0.tgz#61f7b3e3770daeb24062dae3eedef1b054155986"
|
|
||||||
integrity sha512-DY6pjwRhdARE4TDw7XjxjZsbx9lKmIcyZoZ+SDO7SBJ1KUeWNxT22Kara2AC7u6/c2SYEHlEDLnzBCcNhLE8Vg==
|
|
||||||
dependencies:
|
|
||||||
history "^4.7.2"
|
|
||||||
hoist-non-react-statics "^2.3.0"
|
|
||||||
invariant "^2.2.2"
|
|
||||||
loose-envify "^1.3.1"
|
|
||||||
path-to-regexp "^1.7.0"
|
|
||||||
prop-types "^15.5.4"
|
|
||||||
warning "^3.0.0"
|
|
||||||
|
|
||||||
react-router@^4.3.1:
|
react-router@^4.3.1:
|
||||||
version "4.3.1"
|
version "4.3.1"
|
||||||
resolved "https://registry.yarnpkg.com/react-router/-/react-router-4.3.1.tgz#aada4aef14c809cb2e686b05cee4742234506c4e"
|
resolved "https://registry.yarnpkg.com/react-router/-/react-router-4.3.1.tgz#aada4aef14c809cb2e686b05cee4742234506c4e"
|
||||||
|
|
Loading…
Reference in a new issue