mirror of
https://github.com/ant-design/ant-design.git
synced 2024-12-05 01:19:45 +08:00
4f16966e28
* fix * refactor[Wave]: CC => FC * fix lint * fix * fix * fix * add test case * add test case * fix test * fix test * test case * add test case * fix * fix * fix * fix * raname * fix * test case * test case * test case * fix test * test case * refactor: Use React way * test: coverage * chore: clean up * rerun fail ci * fix: React 17 error * test: fix test case * test: fix test case * fix borderRadius * test: fix test case * chore: clean up * chore: clean up Co-authored-by: 二货机器人 <smith3816@gmail.com>
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;
|
|
}
|