From cae628537c6a73ffaf8058ab1874fa16844bf0cc Mon Sep 17 00:00:00 2001 From: Eric NGUYEN Date: Wed, 31 Aug 2022 17:47:37 +0200 Subject: [PATCH] Fix UseFitOnce --- src/Components/SVG/SVG.tsx | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/Components/SVG/SVG.tsx b/src/Components/SVG/SVG.tsx index 7af91b1..0cc6311 100644 --- a/src/Components/SVG/SVG.tsx +++ b/src/Components/SVG/SVG.tsx @@ -124,8 +124,10 @@ export function SVG(props: ISVGProps): JSX.Element { ); } -function UseFitOnce(svgViewer: React.RefObject) { + +function UseFitOnce(svgViewer: React.RefObject): void { React.useEffect(() => { svgViewer?.current?.fitToViewer(); + // eslint-disable-next-line react-hooks/exhaustive-deps }, []); }