2 * Copyright (c) Meta Platforms, Inc. and affiliates.
4 * This source code is licensed under the MIT license found in the
5 * LICENSE file in the root directory of this source tree.
9 import React from 'react';
11 // Webpack + React 17 fails to compile on the usage of `React.startTransition` or
12 // `React["startTransition"]` even if it's behind a feature detection of
13 // `"startTransition" in React`. Moving this to a constant avoids the issue :/
14 const START_TRANSITION = 'startTransition';
16 export function startTransition(callback: () => void) {
17 if (START_TRANSITION in React) {
18 React[START_TRANSITION](callback);