File tree Expand file tree Collapse file tree 1 file changed +3
-2
lines changed Expand file tree Collapse file tree 1 file changed +3
-2
lines changed Original file line number Diff line number Diff line change @@ -9,6 +9,7 @@ export interface IFlagProvider {
9
9
unleashClient ?: UnleashClient ;
10
10
startClient ?: boolean ;
11
11
stopClient ?: boolean ;
12
+ startTransition ?: ( fn : ( ) => void ) => void ;
12
13
}
13
14
14
15
const offlineConfig : IConfig = {
@@ -23,9 +24,8 @@ const offlineConfig: IConfig = {
23
24
// save startTransition as var to avoid webpack analysis (https://github.com/webpack/webpack/issues/14814)
24
25
const _startTransition = 'startTransition' ;
25
26
// fallback for React <18 which doesn't support startTransition
26
- const isReactNative = typeof navigator !== 'undefined' && navigator ?. product === 'ReactNative' ;
27
27
// Fallback for React <18 and exclude startTransition if in React Native
28
- const startTransition : ( fn : ( ) => void ) => void = ! isReactNative && React [ _startTransition ]
28
+ const defaultStartTransition : ( fn : ( ) => void ) => void = React [ _startTransition ]
29
29
? React [ _startTransition ]
30
30
: ( fn => fn ( ) ) ;
31
31
@@ -35,6 +35,7 @@ const FlagProvider: FC<PropsWithChildren<IFlagProvider>> = ({
35
35
unleashClient,
36
36
startClient = true ,
37
37
stopClient = true ,
38
+ startTransition = defaultStartTransition
38
39
} ) => {
39
40
const config = customConfig || offlineConfig ;
40
41
const client = React . useRef < UnleashClient > (
You can’t perform that action at this time.
0 commit comments