Remove `qs` dependency from `<_Layout>`,
use native `URLSearchParams` instead.
This commit is contained in:
parent
c3888d658e
commit
1002f06d07
|
@ -16,7 +16,6 @@ import {
|
|||
import { Children, cloneElement } from 'react';
|
||||
import PropTypes from 'prop-types';
|
||||
import { get, isFunction, identity, memoize } from 'lodash';
|
||||
import { parse } from 'qs';
|
||||
import { getHistory, getQuery } from '@woocommerce/navigation';
|
||||
import {
|
||||
PLUGINS_STORE_NAME,
|
||||
|
@ -190,15 +189,6 @@ class _Layout extends Component {
|
|||
} );
|
||||
}
|
||||
|
||||
getQuery( searchString ) {
|
||||
if ( ! searchString ) {
|
||||
return {};
|
||||
}
|
||||
|
||||
const search = searchString.substring( 1 );
|
||||
return parse( search );
|
||||
}
|
||||
|
||||
isWCPaySettingsPage() {
|
||||
const { page, section, tab } = getQuery();
|
||||
return (
|
||||
|
@ -212,7 +202,9 @@ class _Layout extends Component {
|
|||
const { isEmbedded, ...restProps } = this.props;
|
||||
const { location, page } = this.props;
|
||||
const { breadcrumbs } = page;
|
||||
const query = this.getQuery( location && location.search );
|
||||
const query = Object.fromEntries(
|
||||
new URLSearchParams( location && location.search )
|
||||
);
|
||||
|
||||
return (
|
||||
<LayoutContext.Provider
|
||||
|
|
Loading…
Reference in New Issue