@fto-consult/expo-ui 6.21.2 → 6.21.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.
Files changed (2) hide show
  1. package/index.js +5 -4
  2. package/package.json +1 -1
package/index.js CHANGED
@@ -4,7 +4,7 @@ import Provider from "$econtext/Provider";
4
4
  import APP from "$capp/instance";
5
5
  const REGISTER_EVENT = "REGISTER-APP-COMPONENT-ROOT";
6
6
  import {useState,useEffect} from "react";
7
- const hasAPPRegistered = {current:false};
7
+ const appRegisteredRef = {current:false};
8
8
 
9
9
  /****
10
10
  * les options sont de la forme :
@@ -26,12 +26,12 @@ const hasAPPRegistered = {current:false};
26
26
  const MainAppEntry = function(mProps){
27
27
  const [props,setProps] = useState(null);
28
28
  const onRegisterProps = (props)=>{
29
- hasAPPRegistered.current = true;
29
+ appRegisteredRef.current = true;
30
30
  console.log(props," is registered");
31
31
  setProps({...props});
32
32
  }
33
33
  useEffect(()=>{
34
- APP.one(REGISTER_EVENT,onRegisterProps);
34
+ APP.on(REGISTER_EVENT,onRegisterProps);
35
35
  return ()=>{
36
36
  APP.off(REGISTER_EVENT,onRegisterProps);
37
37
  }
@@ -47,7 +47,8 @@ const MainAppEntry = function(mProps){
47
47
  };
48
48
 
49
49
  export default function registerApp (opts){
50
- if(hasAPPRegistered.current) return false;
50
+ if(appRegisteredRef.current) return false;
51
+ console.log("will register event ",opts);
51
52
  return APP.trigger(REGISTER_EVENT,opts);
52
53
  }
53
54
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fto-consult/expo-ui",
3
- "version": "6.21.2",
3
+ "version": "6.21.3",
4
4
  "description": "Bibliothèque de composants UI Expo,react-native",
5
5
  "main": "index.js",
6
6
  "scripts": {