Skip to content

Conversation

@rjwills28
Copy link
Collaborator

This warning is currently thrown when running the tests:

Warning: findDOMNode is deprecated and will be removed in the next major release. Instead, add a ref directly to the element you want to reference. Learn more about using refs safely here: https://reactjs.org/link/strict-mode-find-node
    at Transition (/cs-web-lib/node_modules/react-transition-group/cjs/Transition.js:135:30)
    at CSSTransition (/cs-web-lib/node_modules/react-transition-group/cjs/CSSTransition.js:120:35)
    at SwitchTransition (/cs-web-lib/node_modules/react-transition-group/cjs/SwitchTransition.js:159:35)
    at SwitchableWidget (/cs-web-lib/src/ui/widgets/Slideshow/slideshow.tsx:49:25)
    at div
    at div
    at SlideshowComponent (/cs-web-lib/src/ui/widgets/Slideshow/slideshow.tsx:86:61)

I've followed the advice to pass a ref directly into the element and CSSTransition component. Also see discussion here with a similar suggestion/implementation: reactjs/react-transition-group#668.

Beyond this, I'm actually not sure where the slideshow widget is used? Maybe it can actually be removed...

This warning is shown in the tests. Instead a ref is added to each
element.
Copy link
Collaborator

@abigailalexander abigailalexander left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can confirm this fixes the warning.
I'm also not sure what the use of the Slideshow widget is, as it isn't part of css/phoebus. I agree we should look into whether it could be removed in future

@rjwills28 rjwills28 merged commit a25e906 into master Dec 10, 2024
2 checks passed
@abigailalexander abigailalexander deleted the fix_deprecation_test_warning branch March 19, 2025 08:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants