diff options
| author | Rafi Zadanly <zadanlyr@gmail.com> | 2024-01-19 13:45:56 +0700 |
|---|---|---|
| committer | Rafi Zadanly <zadanlyr@gmail.com> | 2024-01-19 13:45:56 +0700 |
| commit | e7054b1ff60aae39f255210ff0cfa2217e8d844c (patch) | |
| tree | 2c0d28d0582cf07830390d046bf8863b42c3ed76 | |
| parent | 91086d8b1af2e1c0ca9db38d037f6331c9e6131a (diff) | |
Add unique timestamp on image component
| -rw-r--r-- | src-migrate/components/ui/image.tsx | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src-migrate/components/ui/image.tsx b/src-migrate/components/ui/image.tsx index c1dde170..a65d4ec7 100644 --- a/src-migrate/components/ui/image.tsx +++ b/src-migrate/components/ui/image.tsx @@ -11,6 +11,8 @@ const Image = (props: ImageProps) => { const { alt, src, className, rounded, ...rest } = props; const [isLoading, setLoading] = useState(true); + const uniqueTimestamp = new Date().getTime(); + return ( <NextImage className={clsxm( @@ -21,7 +23,7 @@ const Image = (props: ImageProps) => { rounded, className )} - src={src} + src={`${src}?v=${uniqueTimestamp}`} alt={alt} loading='lazy' quality={100} |
