From dfaef86aab28dace93f8661878fe7e56758eb2a1 Mon Sep 17 00:00:00 2001 From: Martina Carella Date: Fri, 24 Nov 2023 10:29:40 +0100 Subject: [PATCH 1/2] fix (#62) --- src/hooks/useDebounceInput.jsx | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/src/hooks/useDebounceInput.jsx b/src/hooks/useDebounceInput.jsx index bcb8042..0a86ffc 100644 --- a/src/hooks/useDebounceInput.jsx +++ b/src/hooks/useDebounceInput.jsx @@ -4,11 +4,16 @@ import React from "react"; * React hook for debounce input. */ export default function useDebounceInput(inputValue, delay, setFunction) { - React.useEffect(() => { + const initialized = React.useRef(""); + React.useEffect(() => { + if (initialized.current !== inputValue) { + initialized.current = inputValue; const timer = setTimeout(() => { setFunction(inputValue); }, delay); return () => clearTimeout(timer); - // eslint-disable-next-line react-hooks/exhaustive-deps - }, [inputValue]); + } + return null; + // eslint-disable-next-line react-hooks/exhaustive-deps + }, [inputValue]); } \ No newline at end of file From f4c3f6edae72cc257ba34c044f028dd94d88fb82 Mon Sep 17 00:00:00 2001 From: Daniele Rosetti Date: Fri, 24 Nov 2023 10:48:33 +0100 Subject: [PATCH 2/2] updated version to 0.1.10 --- CHANGELOG.md | 3 +++ example/package-lock.json | 2 +- example/src/layouts/AppFooter.jsx | 2 +- package-lock.json | 4 ++-- package.json | 2 +- 5 files changed, 8 insertions(+), 5 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 14af5b8..52662e9 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,9 @@ **[Get it on npm](https://www.npmjs.com/package/certego-ui)** +## [v0.1.10](https://github.com/certego/certego-ui/releases/tag/v0.1.9) +Fixed bug in debounce filter + ## [v0.1.9](https://github.com/certego/certego-ui/releases/tag/v0.1.9) Update axios and "size" property diff --git a/example/package-lock.json b/example/package-lock.json index 0e01b0e..b5c362c 100644 --- a/example/package-lock.json +++ b/example/package-lock.json @@ -19,7 +19,7 @@ }, "..": { "name": "@certego/certego-ui", - "version": "0.1.9", + "version": "0.1.10", "license": "MIT", "dependencies": { "classnames": "^2.3.1", diff --git a/example/src/layouts/AppFooter.jsx b/example/src/layouts/AppFooter.jsx index 5f29c9b..d34d5fb 100644 --- a/example/src/layouts/AppFooter.jsx +++ b/example/src/layouts/AppFooter.jsx @@ -5,7 +5,7 @@ import { FaTwitter } from "react-icons/fa"; import { Toaster, ScrollToTopButton, useToastr } from "@certego/certego-ui"; // constants -const CERTEGO_UI_VERSION = "v0.1.9"; +const CERTEGO_UI_VERSION = "v0.1.10"; const selector = (state) => state.toasts; function AppFooter() { diff --git a/package-lock.json b/package-lock.json index 06268e3..174c8d8 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "@certego/certego-ui", - "version": "0.1.9", + "version": "0.1.10", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "@certego/certego-ui", - "version": "0.1.9", + "version": "0.1.10", "license": "MIT", "dependencies": { "classnames": "^2.3.1", diff --git a/package.json b/package.json index c00062e..f856bc0 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@certego/certego-ui", - "version": "0.1.9", + "version": "0.1.10", "description": "certego components library (react.js, reactstrap, etc)", "author": "certego", "license": "MIT",