CHANGED: README
This commit is contained in:
@@ -1,8 +1,8 @@
|
||||
'use client';
|
||||
|
||||
import isEmpty from './utils/utils';
|
||||
import { RippleProps, RipplesProps } from './ripple.types';
|
||||
import { rippleAreaContext } from './ripple-area';
|
||||
import { RippleProps, RipplesProps } from './ripple.types';
|
||||
import RippleEffectBuild from './utils/ripple-effect-builder';
|
||||
import React, {
|
||||
ReactElement,
|
||||
@@ -18,7 +18,7 @@ const Ripples = (props: RipplesProps) => {
|
||||
const firstRender = useRef<boolean>(true);
|
||||
const [pending, startTransition] = useTransition();
|
||||
|
||||
const LifetimeEnd = (child: ReactElement) => {
|
||||
const endLifetime = (child: ReactElement) => {
|
||||
if (child.props.endLifetime) {
|
||||
child.props.endLifetime();
|
||||
}
|
||||
@@ -34,11 +34,11 @@ const Ripples = (props: RipplesProps) => {
|
||||
if (props.children.length > 0 && !pending) {
|
||||
startTransition(() => {
|
||||
if (firstRender.current || isEmpty(ripples)) {
|
||||
setRipples(RippleEffectBuild(props.children, LifetimeEnd));
|
||||
setRipples(RippleEffectBuild(props.children, endLifetime));
|
||||
firstRender.current = false;
|
||||
} else {
|
||||
setRipples(
|
||||
RippleEffectBuild(props.children, LifetimeEnd, ripples),
|
||||
RippleEffectBuild(props.children, endLifetime, ripples),
|
||||
);
|
||||
}
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user