You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 

18 lines
416 B

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;
}