Skip to content

Commit f61d333

Browse files
committed
refactor: rename ref consumption helper
1 parent e5079de commit f61d333

2 files changed

Lines changed: 4 additions & 4 deletions

File tree

src/CSSMotion.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@ export interface CSSMotionState {
110110
prevProps?: CSSMotionProps;
111111
}
112112

113-
export function isRefConsume(children?: CSSMotionProps['children']) {
113+
export function isRefNotConsumed(children?: CSSMotionProps['children']) {
114114
return children?.length < 2;
115115
}
116116

@@ -257,7 +257,7 @@ export function genCSSMotion(config: CSSMotionConfig) {
257257
return motionChildren;
258258
}, [idRef.current]) as React.ReactElement;
259259

260-
if (isRefConsume(children) && supportNodeRef(returnNode)) {
260+
if (isRefNotConsumed(children) && supportNodeRef(returnNode)) {
261261
const originNodeRef = getNodeRef(returnNode);
262262

263263
if (originNodeRef !== nodeRef) {

src/CSSMotionList.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/* eslint react/prop-types: 0 */
22
import * as React from 'react';
33
import type { CSSMotionProps } from './CSSMotion';
4-
import OriginCSSMotion, { isRefConsume } from './CSSMotion';
4+
import OriginCSSMotion, { isRefNotConsumed } from './CSSMotion';
55
import type { KeyObject } from './util/diff';
66
import {
77
diffKeys,
@@ -178,7 +178,7 @@ export function genCSSMotionList(
178178
}
179179
}}
180180
>
181-
{isRefConsume(children)
181+
{isRefNotConsumed(children)
182182
? props =>
183183
(children as ChildrenWithoutRef)({
184184
...props,

0 commit comments

Comments
 (0)