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 9efa64d..b1404f7 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 c7d602a..a6d65fa 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", 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