@fto-consult/expo-ui 8.14.1 → 8.14.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/src/App.js +2 -2
- package/src/AppEntry/index.js +10 -9
package/package.json
CHANGED
package/src/App.js
CHANGED
@@ -13,8 +13,8 @@ import App from "./AppEntry";
|
|
13
13
|
* }
|
14
14
|
*/
|
15
15
|
|
16
|
-
export default function ExpoUIAppEntryProvider({children,
|
16
|
+
export default function ExpoUIAppEntryProvider({children,init,...rest}){
|
17
17
|
return <Provider {...rest}>
|
18
|
-
<App
|
18
|
+
<App init={init} children={children}/>
|
19
19
|
</Provider>
|
20
20
|
}
|
package/src/AppEntry/index.js
CHANGED
@@ -59,10 +59,10 @@ const NAVIGATION_PERSISTENCE_KEY = 'NAVIGATION_STATE';
|
|
59
59
|
* initialRouteName : la route initiale par défaut
|
60
60
|
* getStartedRouteName : la route par défaut de getStarted lorsque l'application est en mode getStarted, c'est à dire lorsque la fonction init renvoie une erreur (reject)
|
61
61
|
*/
|
62
|
-
function App({init:initApp,initialRouteName:appInitialRouteName,children
|
62
|
+
function App({init:initApp,initialRouteName:appInitialRouteName,children}) {
|
63
63
|
AppStateService.init();
|
64
64
|
const SplashScreenComponent = useAppComponent("SplashScreen");
|
65
|
-
const {FontsIconsFilter,beforeExit,AppWrapper,preferences:appPreferences,navigation,getStartedRouteName,components:{MainProvider}} = useContext();
|
65
|
+
const {FontsIconsFilter,beforeExit,AppWrapper,preferences:appPreferences,navigation,getStartedRouteName,withSplashScreen,components:{MainProvider}} = useContext();
|
66
66
|
const {containerProps} = navigation;
|
67
67
|
const [initialState, setInitialState] = React.useState(undefined);
|
68
68
|
const appReadyRef = React.useRef(true);
|
@@ -266,8 +266,9 @@ function App({init:initApp,initialRouteName:appInitialRouteName,children,withSpl
|
|
266
266
|
/>
|
267
267
|
</NavigationContainer> : null;
|
268
268
|
const content = isLoaded ? typeof children == 'function'? children({children:child,appConfig,config:appConfig}) : child : null;
|
269
|
-
const
|
270
|
-
|
269
|
+
const myChildren = <PreferencesContext.Provider value={preferences}>
|
270
|
+
{isLoaded ? React.isValidElement(content) && content || child : null}
|
271
|
+
</PreferencesContext.Provider>;
|
271
272
|
return <SafeAreaProvider>
|
272
273
|
<AppEntryRootView MainProvider={MainProvider} isInitialized={state.hasCallInitApp} isLoading={isLoading} hasGetStarted={hasGetStarted} isLoaded={isLoaded}>
|
273
274
|
<PaperProvider
|
@@ -288,11 +289,11 @@ function App({init:initApp,initialRouteName:appInitialRouteName,children,withSpl
|
|
288
289
|
<DropdownAlert ref={notificationRef}/>
|
289
290
|
<ErrorBoundary>
|
290
291
|
<StatusBar/>
|
291
|
-
<
|
292
|
-
|
293
|
-
|
294
|
-
|
295
|
-
|
292
|
+
{withSplashScreen !== false ? <SplashScreen
|
293
|
+
children = {myChildren}
|
294
|
+
isLoaded = {isLoaded}
|
295
|
+
Component = {SplashScreenComponent}
|
296
|
+
/> : myChildren}
|
296
297
|
</ErrorBoundary>
|
297
298
|
</Portal.Host>
|
298
299
|
</PaperProvider>
|