mirror of
https://github.com/ant-design/ant-design.git
synced 2024-12-15 08:59:15 +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;
|
||
|
}
|