From cc5ab285a0bf0527f8e1390316c4824575c8ff00 Mon Sep 17 00:00:00 2001 From: TomBailey167 <31325922+TomBailey167@users.noreply.github.com> Date: Fri, 30 Apr 2021 08:51:56 +0100 Subject: [PATCH] Fix for issue #154 Fix for issue #154. useEffect dependencies updated to include [date]. This prevents an issue where my nested component doesn't update on its own. --- src/index.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/index.js b/src/index.js index dbdb785..9ce5054 100644 --- a/src/index.js +++ b/src/index.js @@ -112,7 +112,7 @@ export default function TimeAgo({ return () => { clearTimeout(timeoutId) } - }, []) + }, [date]) const Komponent = component const then = dateParser(date).valueOf()