fix: align frontend types and tests for react 19 (#339)

This commit is contained in:
Daniel Volz
2026-02-27 01:01:48 +01:00
committed by GitHub
parent 6b27d234d9
commit cc22f80209
23 changed files with 166 additions and 74 deletions
+4 -1
View File
@@ -2,7 +2,7 @@
// MedicationAvatar Component
// =============================================================================
import { useEffect, useState } from "react";
import { useEffect, useRef, useState } from "react";
export type MedicationAvatarProps = {
name: string;
@@ -12,8 +12,11 @@ export type MedicationAvatarProps = {
export function MedicationAvatar({ name, imageUrl, size = "sm" }: MedicationAvatarProps) {
const [thumbFailed, setThumbFailed] = useState(false);
const previousImageUrlRef = useRef(imageUrl);
useEffect(() => {
if (previousImageUrlRef.current === imageUrl) return;
previousImageUrlRef.current = imageUrl;
setThumbFailed(false);
}, [imageUrl]);