# All files / src react-versions.ts

75% Statements 3/4
80% Branches 4/5
100% Functions 1/1
100% Lines 3/3

Press n or j to go to the next uncovered block, b, p or k for the previous block.

    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12

    167x
    167x

    167x

     import * as React from 'react';

    export function checkReactVersionAtLeast(
      major: number,
      minor: number
    ): boolean {
      Iif (React.version === undefined) return false;
      const [actualMajor, actualMinor] = React.version.split('.').map(Number);

      return actualMajor > major || (actualMajor === major && actualMinor >= minor);
    }