From b056895a044b0d5df650ffd6603c0133ceaf80a6 Mon Sep 17 00:00:00 2001 From: Matthew Crosby Date: Fri, 4 Oct 2019 11:41:11 -0600 Subject: [PATCH] Fixes prop type warning for location being undefined: adds search prop to 'get-location()', removes query --- src/app/components/Router/get-location.js | 2 +- src/app/components/__tests__/router.test.js | 4 ++-- .../__tests__/__snapshots__/html-to-react.test.js.snap | 2 +- src/loaders/html-to-react.js | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/app/components/Router/get-location.js b/src/app/components/Router/get-location.js index 42b945bc4..3191922c1 100644 --- a/src/app/components/Router/get-location.js +++ b/src/app/components/Router/get-location.js @@ -2,7 +2,7 @@ const getLocation = Location => ({ href: Location.href, pathname: Location.pathname, hash: Location.hash, - query: Location.query + search: Location.search }); export default getLocation; diff --git a/src/app/components/__tests__/router.test.js b/src/app/components/__tests__/router.test.js index 80b5ccc57..0d8e29180 100644 --- a/src/app/components/__tests__/router.test.js +++ b/src/app/components/__tests__/router.test.js @@ -13,7 +13,7 @@ test('getLocation', () => { href: 'href', pathname: 'pathname', hash: 'hash', - query: 'query', + search: 'search', other: true, prosp: 1, excluded: '1000' @@ -22,7 +22,7 @@ test('getLocation', () => { href: 'href', pathname: 'pathname', hash: 'hash', - query: 'query' + search: 'search' }); }); diff --git a/src/loaders/__tests__/__snapshots__/html-to-react.test.js.snap b/src/loaders/__tests__/__snapshots__/html-to-react.test.js.snap index d1a87894c..07dc7e213 100644 --- a/src/loaders/__tests__/__snapshots__/html-to-react.test.js.snap +++ b/src/loaders/__tests__/__snapshots__/html-to-react.test.js.snap @@ -214,7 +214,7 @@ Object { href: Location.href, pathname: Location.pathname, hash: Location.hash, - query: Location.query + search: Location.search }); const Link = props => { diff --git a/src/loaders/html-to-react.js b/src/loaders/html-to-react.js index cf3fa13a3..88c515e21 100644 --- a/src/loaders/html-to-react.js +++ b/src/loaders/html-to-react.js @@ -335,7 +335,7 @@ const createLink = (pathToMarkdown, options) =>` href: Location.href, pathname: Location.pathname, hash: Location.hash, - query: Location.query + search: Location.search }); const Link = props => {