Skip to content

Commit

Permalink
Merge branch 'master' into feature-merge-master
Browse files Browse the repository at this point in the history
  • Loading branch information
li-jia-nan committed May 10, 2024
2 parents bc26758 + 6da1ad1 commit 20208bf
Show file tree
Hide file tree
Showing 10 changed files with 1,745 additions and 1,296 deletions.
183 changes: 0 additions & 183 deletions .dumi/pages/index/components/Banner.tsx

This file was deleted.

3 changes: 3 additions & 0 deletions components/_util/__tests__/wave.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,7 @@ describe('Wave component', () => {
}

it('work', async () => {
const errorSpy = jest.spyOn(console, 'error').mockImplementation(() => {});
const { container, unmount } = render(
<Wave>
<button type="button">button</button>
Expand All @@ -95,6 +96,8 @@ describe('Wave component', () => {

expect(document.querySelector('.ant-wave')).toBeFalsy();

expect(errorSpy).not.toHaveBeenCalled();

unmount();
});

Expand Down
7 changes: 4 additions & 3 deletions components/_util/wave/WaveEffect.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import classNames from 'classnames';
import CSSMotion from 'rc-motion';
import raf from 'rc-util/lib/raf';
import { render, unmount } from 'rc-util/lib/React/render';
import { composeRef } from 'rc-util/es/ref';

import { TARGET_CLS } from './interface';
import type { ShowWaveEffect } from './interface';
Expand All @@ -20,7 +21,7 @@ export interface WaveEffectProps {

const WaveEffect: React.FC<WaveEffectProps> = (props) => {
const { className, target, component } = props;
const divRef = React.useRef<HTMLDivElement>(null);
const divRef = React.useRef<HTMLDivElement | null>(null);

const [color, setWaveColor] = React.useState<string | null>(null);
const [borderRadius, setBorderRadius] = React.useState<number[]>([]);
Expand Down Expand Up @@ -125,9 +126,9 @@ const WaveEffect: React.FC<WaveEffectProps> = (props) => {
return false;
}}
>
{({ className: motionClassName }) => (
{({ className: motionClassName }, ref) => (
<div
ref={divRef}
ref={composeRef(divRef, ref)}
className={classNames(
className,
{
Expand Down
Loading

0 comments on commit 20208bf

Please sign in to comment.