@fto-consult/expo-ui 8.14.2 → 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 -10
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,9 +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
|
-
|
271
|
-
|
269
|
+
const myChildren = <PreferencesContext.Provider value={preferences}>
|
270
|
+
{isLoaded ? React.isValidElement(content) && content || child : null}
|
271
|
+
</PreferencesContext.Provider>;
|
272
272
|
return <SafeAreaProvider>
|
273
273
|
<AppEntryRootView MainProvider={MainProvider} isInitialized={state.hasCallInitApp} isLoading={isLoading} hasGetStarted={hasGetStarted} isLoaded={isLoaded}>
|
274
274
|
<PaperProvider
|
@@ -289,11 +289,11 @@ function App({init:initApp,initialRouteName:appInitialRouteName,children,withSpl
|
|
289
289
|
<DropdownAlert ref={notificationRef}/>
|
290
290
|
<ErrorBoundary>
|
291
291
|
<StatusBar/>
|
292
|
-
<
|
293
|
-
|
294
|
-
|
295
|
-
|
296
|
-
|
292
|
+
{withSplashScreen !== false ? <SplashScreen
|
293
|
+
children = {myChildren}
|
294
|
+
isLoaded = {isLoaded}
|
295
|
+
Component = {SplashScreenComponent}
|
296
|
+
/> : myChildren}
|
297
297
|
</ErrorBoundary>
|
298
298
|
</Portal.Host>
|
299
299
|
</PaperProvider>
|