react-component / motion
Showing 1 of 5 files from the diff.
Other files ignored by Codecov
.prettierrc has changed.
.gitignore has changed.

@@ -5,12 +5,13 @@
Loading
5 5
import { fillRef } from 'rc-util/lib/ref';
6 6
import classNames from 'classnames';
7 7
import { getTransitionName, supportTransition } from './util/motion';
8 -
import {
8 +
import type {
9 9
  MotionStatus,
10 -
  STATUS_NONE,
11 10
  MotionEventHandler,
12 11
  MotionEndEventHandler,
13 -
  MotionPrepareEventHandler,
12 +
  MotionPrepareEventHandler} from './interface';
13 +
import {
14 +
  STATUS_NONE,
14 15
  STEP_PREPARE,
15 16
  STEP_START,
16 17
} from './interface';
@@ -156,6 +157,13 @@
Loading
156 157
      props,
157 158
    );
158 159
160 +
    // Record whether content has rended
161 +
    // Will return null for un-rendered even when `removeOnLeave={false}`
162 +
    const renderedRef = React.useRef(mergedVisible);
163 +
    if (mergedVisible) {
164 +
      renderedRef.current = true;
165 +
    }
166 +
159 167
    // ====================== Refs ======================
160 168
    const originRef = useRef(ref);
161 169
    originRef.current = ref;
@@ -177,7 +185,7 @@
Loading
177 185
      // Stable children
178 186
      if (mergedVisible) {
179 187
        motionChildren = children({ ...mergedProps }, setNodeRef);
180 -
      } else if (!removeOnLeave) {
188 +
      } else if (!removeOnLeave && renderedRef.current) {
181 189
        motionChildren = children(
182 190
          { ...mergedProps, className: leavedClassName },
183 191
          setNodeRef,
Files Coverage
src 98.63%
Project Totals (12 files) 98.63%

No yaml found.

Create your codecov.yml to customize your Codecov experience

Sunburst
The inner-most circle is the entire project, moving away from the center are folders then, finally, a single file. The size and color of each slice is representing the number of statements and the coverage, respectively.
Icicle
The top section represents the entire project. Proceeding with folders and finally individual files. The size and color of each slice is representing the number of statements and the coverage, respectively.
Grid
Each block represents a single file in the project. The size and color of each block is represented by the number of statements and the coverage, respectively.
Loading