diff --git a/components/lib/ripple/Ripple.js b/components/lib/ripple/Ripple.js index 7afacb8bae..a12e85141d 100644 --- a/components/lib/ripple/Ripple.js +++ b/components/lib/ripple/Ripple.js @@ -5,7 +5,7 @@ import { DomHandler, classNames, mergeProps } from '../utils/Utils'; import { RippleBase } from './RippleBase'; export const Ripple = React.memo( - React.forwardRef((inProps) => { + React.forwardRef((inProps, ref) => { const inkRef = React.useRef(null); const targetRef = React.useRef(null); const context = React.useContext(PrimeReactContext); @@ -72,6 +72,12 @@ export const Ripple = React.memo( } }; + React.useImperativeHandle(ref, () => ({ + props, + getInk: () => inkRef.current, + getTarget: () => targetRef.current + })); + useMountEffect(() => { if (inkRef.current) { targetRef.current = getTarget();