fix(ui-motion): use elementRef instead of ref in BaseTransition renderChildren#2514
fix(ui-motion): use elementRef instead of ref in BaseTransition renderChildren#2514Gazuru wants to merge 1 commit into
Conversation
|
83e995a to
bc37bd6
Compare
|
@Gazuru The
Screen.Recording.2026-05-19.at.13.13.42.movScreen.Recording.2026-05-19.at.13.17.31.mov |
bc37bd6 to
f39a982
Compare
…apping class components in Transition BaseTransition.renderChildren inspects the child's React type to decide which ref props to attach: - host elements (<div>, <span>) receive a plain ref callback - forwardRef components (including memo-wrapped ones) receive both elementRef (the InstUI convention) and ref (for non-InstUI forwardRef children) - any other component shape (class, plain function, Context.Provider, etc.) receives elementRef only, since attaching ref to a non-forwardRef component would bind to the class instance or trigger a React warning handleChildRef ignores non-Element values so that a forwardRef chain landing on a class instance does not clobber a DOM node already captured via elementRef. Alert.handleRef forwards the consumer-supplied elementRef so that parents like Transition can observe Alert's mounted DOM node; without chaining, Alert silently swallowed the elementRef it received.
f39a982 to
d9171f0
Compare
Visual regression report✅ No changes.
Baselines come from the |
|
Looks good now:
The only issue might be that as findDOMNode has been removed, non-InstUI class components wrapped in check this example in the master vs this PR |
Summary
Alert: 'ref' is not a propwarning that appears when wrapping<Alert>(or any InstUI class component) in<Transition>.BaseTransitionnow routes refs by child kind: host elements getref, forwardRef components getref+elementRef, anything else gets onlyelementRef. No more passingrefto non-forwardRef components.Alert.handleRefchains the consumer-suppliedelementRefso the DOM node still reaches the wrappingTransitionand the fade in/out works end-to-end.Fixes LX-4024.