react-component / motion

Compare a5e107c ... +0 ... 30b868a

No flags found

Use flags to group coverage reports by test type, project and/or folders.
Then setup custom commit statuses and notifications for each flag.

e.g., #unittest #integration

#production #enterprise

#frontend #backend

Learn more about Codecov Flags here.

Showing 1 of 2 files from the diff.
Other files ignored by Codecov

@@ -9,12 +9,9 @@
Loading
9 9
  MotionStatus,
10 10
  MotionEventHandler,
11 11
  MotionEndEventHandler,
12 -
  MotionPrepareEventHandler} from './interface';
13 -
import {
14 -
  STATUS_NONE,
15 -
  STEP_PREPARE,
16 -
  STEP_START,
12 +
  MotionPrepareEventHandler,
17 13
} from './interface';
14 +
import { STATUS_NONE, STEP_PREPARE, STEP_START } from './interface';
18 15
import useStatus from './hooks/useStatus';
19 16
import DomWrapper from './DomWrapper';
20 17
import { isActive } from './hooks/useStepQueue';
@@ -135,15 +132,19 @@
Loading
135 132
    const supportMotion = isSupportTransition(props);
136 133
137 134
    // Ref to the react node, it may be a HTMLElement
138 -
    const nodeRef = useRef();
135 +
    const nodeRef = useRef<any>();
139 136
    // Ref to the dom wrapper in case ref can not pass to HTMLElement
140 137
    const wrapperNodeRef = useRef();
141 138
142 139
    function getDomElement() {
143 140
      try {
144 -
        return findDOMNode<HTMLElement>(
145 -
          nodeRef.current || wrapperNodeRef.current,
146 -
        );
141 +
        // Here we're avoiding call for findDOMNode since it's deprecated
142 +
        // in strict mode. We're calling it only when node ref is not
143 +
        // an instance of DOM HTMLElement. Otherwise use
144 +
        // findDOMNode as a final resort
145 +
        return nodeRef.current instanceof HTMLElement
146 +
          ? nodeRef.current
147 +
          : findDOMNode<HTMLElement>(wrapperNodeRef.current);
147 148
      } catch (e) {
148 149
        // Only happen when `motionDeadline` trigger but element removed.
149 150
        return null;
@@ -157,21 +158,17 @@
Loading
157 158
      props,
158 159
    );
159 160
160 -
    // Record whether content has rended
161 +
    // Record whether content has rendered
161 162
    // Will return null for un-rendered even when `removeOnLeave={false}`
162 163
    const renderedRef = React.useRef(mergedVisible);
163 164
    if (mergedVisible) {
164 165
      renderedRef.current = true;
165 166
    }
166 167
167 168
    // ====================== Refs ======================
168 -
    const originRef = useRef(ref);
169 -
    originRef.current = ref;
170 -
171 169
    const setNodeRef = React.useCallback((node: any) => {
172 170
      nodeRef.current = node;
173 -
174 -
      fillRef(originRef.current, node);
171 +
      fillRef(ref, node);
175 172
    }, []);
176 173
177 174
    // ===================== Render =====================
@@ -213,10 +210,8 @@
Loading
213 210
        {
214 211
          ...mergedProps,
215 212
          className: classNames(getTransitionName(motionName, status), {
216 -
            [getTransitionName(
217 -
              motionName,
218 -
              `${status}-${statusSuffix}`,
219 -
            )]: statusSuffix,
213 +
            [getTransitionName(motionName, `${status}-${statusSuffix}`)]:
214 +
              statusSuffix,
220 215
            [motionName as string]: typeof motionName === 'string',
221 216
          }),
222 217
          style: statusStyle,

Everything is accounted for!

No changes detected that need to be reviewed.
What changes does Codecov check for?
Lines, not adjusted in diff, that have changed coverage data.
Files that introduced coverage data that had none before.
Files that have missing coverage data that once were tracked.
Files Coverage
src -0.28% 98.35%
Project Totals (12 files) 98.35%
Loading