From f3d82a3276601758e039a48b41cc46ca60060497 Mon Sep 17 00:00:00 2001 From: Rebecca Williams Date: Tue, 10 Dec 2024 11:50:31 +0000 Subject: [PATCH] Fix findDOMNode deprecation warning in slideshow widget This warning is shown in the tests. Instead a ref is added to each element. --- src/ui/widgets/Slideshow/slideshow.tsx | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/src/ui/widgets/Slideshow/slideshow.tsx b/src/ui/widgets/Slideshow/slideshow.tsx index 84485157..c15ddd8e 100644 --- a/src/ui/widgets/Slideshow/slideshow.tsx +++ b/src/ui/widgets/Slideshow/slideshow.tsx @@ -31,10 +31,15 @@ export const SwitchableWidget = (props: { index: number; children: [ReactElement]; transition: { readonly [key: string]: string }; + nodeRef: React.Ref; }): JSX.Element => { + // react-transition-group internally uses findDOMNode which + // is deprecated. Fix by passing nodeRef which points to the + // transitioning child. return ( (null); return (
- + {props.children as [ReactElement]}