@baggie/react
Advanced tools
Comparing version 1.1.1 to 1.1.2
# Changelog | ||
## [1.1.2](https://github.com/saxofonsolo/baggie/compare/react-v1.1.1...react-v1.1.2) (2023-10-11) | ||
### Bug Fixes | ||
* **react:** Only set params in useQueryState if value has changed ([7bb7feb](https://github.com/saxofonsolo/baggie/commit/7bb7feb8be04f0f4126e65ba74d20999176129e1)) | ||
## [1.1.1](https://github.com/saxofonsolo/baggie/compare/react-v1.1.0...react-v1.1.1) (2023-09-15) | ||
@@ -4,0 +11,0 @@ |
@@ -39,4 +39,6 @@ import { useMemo, useRef, useCallback, useEffect } from 'react'; | ||
const newValue = toggle && actualValue === stateRef.current ? null : actualValue; | ||
setParams(newValue); | ||
stateRef.current = newValue; | ||
if (stateRef.current !== newValue) { | ||
setParams(newValue); | ||
stateRef.current = newValue; | ||
} | ||
}, | ||
@@ -43,0 +45,0 @@ [opts?.toggle, setParams] |
{ | ||
"name": "@baggie/react", | ||
"version": "1.1.1", | ||
"version": "1.1.2", | ||
"description": "A library of tools for your React project", | ||
@@ -29,18 +29,15 @@ "license": "MIT", | ||
"sideEffects": false, | ||
"resolutions": { | ||
"jackspeak": "2.1.1" | ||
}, | ||
"peerDependencies": { | ||
"react": "^18.2.0", | ||
"react-dom": "^18.2.0", | ||
"react-router-dom": "^6.15.0" | ||
"react-router-dom": "^6.16.0" | ||
}, | ||
"devDependencies": { | ||
"@vitejs/plugin-react": "^4.0.4", | ||
"rimraf": "^5.0.1", | ||
"@vitejs/plugin-react": "^4.1.0", | ||
"rimraf": "^5.0.5", | ||
"typescript": "^5.2.2", | ||
"vite-plugin-css-injected-by-js": "^3.3.0", | ||
"vite-plugin-dts": "^3.5.3" | ||
"vite-plugin-dts": "^3.6.0" | ||
}, | ||
"gitHead": "985da4250f8f3aee48b8ec6ee5b810491fdf166d" | ||
} |
@@ -84,4 +84,8 @@ import { useCallback, useEffect, useMemo, useRef } from "react"; | ||
toggle && actualValue === stateRef.current ? null : actualValue; | ||
setParams(newValue); | ||
stateRef.current = newValue; | ||
// Only update if value has changed | ||
if (stateRef.current !== newValue) { | ||
setParams(newValue); | ||
stateRef.current = newValue; | ||
} | ||
}, | ||
@@ -88,0 +92,0 @@ [opts?.toggle, setParams], |
Sorry, the diff of this file is not supported yet
90146
1833