react-transition-group: pass nodeRef so findDOMNode isn't used#1108
react-transition-group: pass nodeRef so findDOMNode isn't used#1108mischnic wants to merge 5 commits into
Conversation
| // @ts-ignore | ||
| let tooltipWithRef = React.cloneElement(tooltip, {ref: node => { | ||
| tooltipRef.current = node; | ||
| // @ts-ignore | ||
| if (tooltip.ref) { | ||
| // @ts-ignore | ||
| tooltip.ref.current = node; | ||
| } | ||
| }}); |
There was a problem hiding this comment.
I couldn't find a better way to do this
There was a problem hiding this comment.
i'm guessing merging them in a useEffect is too late?
There was a problem hiding this comment.
What do you have in mind?
There was a problem hiding this comment.
we have some ref merging logic around the repo that takes place in a useEffect, trying to find some examples
it uses context usually though if i recall correctly
There was a problem hiding this comment.
here's the one i was thinking of https://github.com/adobe/react-spectrum/blob/main/packages/@react-aria/interactions/src/DOMPropsContext.ts#L37
I've no idea if it'll help you out
There was a problem hiding this comment.
I don't think so, it could still be the case that the tooltip doesn't have a ref yet and I still need to do cloneElement then...
|
Build successful! 🎉 |
15c5498 to
6ef1c53
Compare
|
Build successful! 🎉 |
6ef1c53 to
925768e
Compare
|
Build successful! 🎉 |
|
@mischnic got a conflict :( |
925768e to
27e5d01
Compare
27e5d01 to
577d2c5
Compare
|
Closing due to CLA, I've reopened it here #1241 |
Part of #779
There are more problems with strict mode (which is why I didn't enable strict mode in tests or Storybook yet), this is just fixing the react-transition-group and findDOMNode problem.