@baggie/react
Advanced tools
Comparing version 1.2.0 to 1.2.1
@@ -5,3 +5,5 @@ import { useMemo, useRef, useCallback, useEffect } from 'react'; | ||
function useQueryMapper(valueToParams, paramsToValue, options) { | ||
const [searchParams, setSearchParams] = useSearchParams(); | ||
const [searchParams, setSearchParams] = useSearchParams( | ||
options?.defaultValue ? valueToParams(options.defaultValue) : void 0 | ||
); | ||
const state = useMemo(() => { | ||
@@ -8,0 +10,0 @@ const entries = Array.from(searchParams.entries()); |
{ | ||
"name": "@baggie/react", | ||
"version": "1.2.0", | ||
"version": "1.2.1", | ||
"description": "A library of tools for your React project", | ||
@@ -5,0 +5,0 @@ "type": "module", |
@@ -16,3 +16,5 @@ import { useCallback, useEffect, useMemo, useRef } from "react"; | ||
): [T, (value: T | ((prev: T) => T)) => void] { | ||
const [searchParams, setSearchParams] = useSearchParams(); | ||
const [searchParams, setSearchParams] = useSearchParams( | ||
options?.defaultValue ? valueToParams(options.defaultValue) : undefined, | ||
); | ||
@@ -19,0 +21,0 @@ const state = useMemo(() => { |
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
100464
2056