use-query-params
Advanced tools
Comparing version 2.0.0 to 2.0.1
@@ -40,3 +40,3 @@ "use strict"; | ||
get location() { | ||
return location; | ||
return history.location; | ||
} | ||
@@ -43,0 +43,0 @@ }; |
@@ -15,3 +15,3 @@ import { useHistory, useLocation } from "react-router"; | ||
get location() { | ||
return location; | ||
return history.location; | ||
} | ||
@@ -18,0 +18,0 @@ }; |
@@ -26,6 +26,9 @@ "use strict"; | ||
module.exports = __toCommonJS(src_exports); | ||
var import_react = require("react"); | ||
var import_react_router = require("react-router"); | ||
var import_react_router_dom = require("react-router-dom"); | ||
var ReactRouter6Adapter = ({ | ||
children | ||
}) => { | ||
const { navigator } = (0, import_react.useContext)(import_react_router_dom.UNSAFE_NavigationContext); | ||
const navigate = (0, import_react_router.useNavigate)(); | ||
@@ -47,3 +50,4 @@ const location = (0, import_react_router.useLocation)(); | ||
get location() { | ||
return location; | ||
var _a; | ||
return (_a = navigator == null ? void 0 : navigator.location) != null ? _a : location; | ||
} | ||
@@ -50,0 +54,0 @@ }; |
@@ -0,5 +1,8 @@ | ||
import { useContext } from "react"; | ||
import { useNavigate, useLocation } from "react-router"; | ||
import { UNSAFE_NavigationContext } from "react-router-dom"; | ||
const ReactRouter6Adapter = ({ | ||
children | ||
}) => { | ||
const { navigator } = useContext(UNSAFE_NavigationContext); | ||
const navigate = useNavigate(); | ||
@@ -21,3 +24,4 @@ const location = useLocation(); | ||
get location() { | ||
return location; | ||
var _a; | ||
return (_a = navigator == null ? void 0 : navigator.location) != null ? _a : location; | ||
} | ||
@@ -24,0 +28,0 @@ }; |
@@ -251,3 +251,3 @@ "use strict"; | ||
for (const paramName in encodedValues) { | ||
if ((_a = paramConfigMap[paramName]) == null ? void 0 : _a.urlName) { | ||
if (((_a = paramConfigMap[paramName]) == null ? void 0 : _a.urlName) != null) { | ||
newEncodedValues[paramConfigMap[paramName].urlName] = encodedValues[paramName]; | ||
@@ -254,0 +254,0 @@ } else { |
{ | ||
"name": "use-query-params", | ||
"version": "2.0.0", | ||
"version": "2.0.1", | ||
"description": "React Hook for managing state in URL query parameters with easy serialization.", | ||
@@ -92,4 +92,4 @@ "main": "./index.cjs.js", | ||
}, | ||
"gitHead": "17a70ebac972db14b69cda83e50eba8a6020c54e", | ||
"gitHead": "cd268683522159d76b06843fe3ef73c6c9211e0c", | ||
"types": "./index.d.ts" | ||
} |
@@ -26,3 +26,3 @@ function serializeUrlNameMap(paramConfigMap) { | ||
for (const paramName in encodedValues) { | ||
if ((_a = paramConfigMap[paramName]) == null ? void 0 : _a.urlName) { | ||
if (((_a = paramConfigMap[paramName]) == null ? void 0 : _a.urlName) != null) { | ||
newEncodedValues[paramConfigMap[paramName].urlName] = encodedValues[paramName]; | ||
@@ -29,0 +29,0 @@ } else { |
{ | ||
"name": "use-query-params", | ||
"version": "2.0.0", | ||
"version": "2.0.1", | ||
"description": "React Hook for managing state in URL query parameters with easy serialization.", | ||
@@ -92,3 +92,3 @@ "main": "./dist/index.cjs.js", | ||
}, | ||
"gitHead": "17a70ebac972db14b69cda83e50eba8a6020c54e" | ||
"gitHead": "cd268683522159d76b06843fe3ef73c6c9211e0c" | ||
} |
@@ -45,4 +45,4 @@ import { EncodedValueMap, QueryParamConfigMap } from 'serialize-query-params'; | ||
for (const paramName in encodedValues) { | ||
if (paramConfigMap[paramName]?.urlName) { | ||
newEncodedValues[paramConfigMap[paramName].urlName] = | ||
if (paramConfigMap[paramName]?.urlName != null) { | ||
newEncodedValues[paramConfigMap[paramName].urlName!] = | ||
encodedValues[paramName]; | ||
@@ -49,0 +49,0 @@ } else { |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
288376
4763