@fto-consult/expo-ui 5.7.12 → 5.8.0

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.
Files changed (2) hide show
  1. package/package.json +1 -1
  2. package/src/App.js +4 -2
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fto-consult/expo-ui",
3
- "version": "5.7.12",
3
+ "version": "5.8.0",
4
4
  "description": "Bibliothèque de composants UI Expo,react-native",
5
5
  "main": "index.js",
6
6
  "scripts": {
package/src/App.js CHANGED
@@ -30,7 +30,9 @@ Object.map(Utils,(v,i)=>{
30
30
  window[i] = v;
31
31
  }
32
32
  });
33
- export default function getIndex({onMount,onUnmount,swrConfig,onRender,preferences:appPreferences,...rest}){
33
+ export default function getIndex({onMount,onUnmount,swrConfig,render,onRender,preferences:appPreferences,...rest}){
34
+ const child = <Index {...rest} theme={theme}/>;
35
+ const content = typeof render == 'function'? render({children:child}) : child;
34
36
  const isScreenFocusedRef = React.useRef(true);
35
37
  ///garde pour chaque écran sa date de dernière activité
36
38
  const screensRef = React.useRef({});//la liste des écrans actifs
@@ -171,7 +173,7 @@ export default function getIndex({onMount,onUnmount,swrConfig,onRender,preferenc
171
173
  <ErrorBoundary>
172
174
  <StatusBar/>
173
175
  <PreferencesContext.Provider value={preferences}>
174
- {<Index {...rest} theme={theme}/>}
176
+ {React.isValidElement(content) && content || child}
175
177
  </PreferencesContext.Provider>
176
178
  </ErrorBoundary>
177
179
  </AuthProvider>