File tree 1 file changed +4
-1
lines changed
1 file changed +4
-1
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,14 +24,16 @@ 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 startTransition = React [ _startTransition ] || ( fn => fn ( ) ) ;
27
+ // Fallback for React <18 and exclude startTransition if in React Native
28
+ const defaultStartTransition = React [ _startTransition ] || ( fn => fn ( ) ) ;
27
29
28
30
const FlagProvider : FC < PropsWithChildren < IFlagProvider > > = ( {
29
31
config : customConfig ,
30
32
children,
31
33
unleashClient,
32
34
startClient = true ,
33
35
stopClient = true ,
36
+ startTransition = defaultStartTransition
34
37
} ) => {
35
38
const config = customConfig || offlineConfig ;
36
39
const client = React . useRef < UnleashClient > (
You can’t perform that action at this time.
0 commit comments