GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — fix: fix playground · gregberge/svgr@c7ad69f

File tree

Expand file treeCollapse file tree
Open diff view settings
Filter options
  • website/src/components/playground
    • Query.js
Expand file treeCollapse file tree
Open diff view settings
Collapse file

‎website/src/components/playground/Query.js‎

Copy file name to clipboardExpand all lines: website/src/components/playground/Query.js
+6-4Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,16 +12,18 @@ function formatQuery(state, initialState) {
1212
},
1313
{},
1414
)
15-
return qs.stringify(lightState, { arrayFormat: 'bracket' })
15+
const qsStr = qs.stringify(lightState, { arrayFormat: 'bracket' })
16+
return qsStr ? `?${qsStr}` : ''
1617
}
1718

1819
function parseQuery(query) {
1920
return qs.parse(query, { arrayFormat: 'bracket', parseBooleans: true })
2021
}
2122

2223
function getLocation() {
23-
if (typeof window === 'undefined') return { search: '', pathname: '' }
24-
return window.location
24+
if (typeof window === 'undefined')
25+
return { location: { search: '', pathname: '' } }
26+
return { location: window.location }
2527
}
2628

2729
let browserHistory
@@ -47,7 +49,7 @@ function useLocation() {
4749
export function useQuery(getInitialState = {}) {
4850
const history = useHistory()
4951
const [initialState] = React.useState(getInitialState)
50-
const location = useLocation()
52+
const { location } = useLocation()
5153
const locationRef = React.useRef(location)
5254
React.useEffect(() => {
5355
locationRef.current = location

0 commit comments

Comments
0 (0)
You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.