mirror of
https://github.com/ant-design/ant-design.git
synced 2024-12-05 17:59:57 +08:00
19 lines
416 B
TypeScript
19 lines
416 B
TypeScript
|
import showWaveEffect from './WaveEffect';
|
||
|
|
||
|
export default function useWave(
|
||
|
nodeRef: React.RefObject<HTMLElement>,
|
||
|
className: string,
|
||
|
): VoidFunction {
|
||
|
function showWave() {
|
||
|
const node = nodeRef.current!;
|
||
|
|
||
|
// Skip if not exist doc
|
||
|
const container = node.getRootNode?.() || node?.ownerDocument;
|
||
|
if (container) {
|
||
|
showWaveEffect(container, node, className);
|
||
|
}
|
||
|
}
|
||
|
|
||
|
return showWave;
|
||
|
}
|