Browse Source

fixing ViewPropTypes error in the splash-screen and the expo-doctor error

master
Joselito Lima 1 year ago
parent
commit
00c7f74677
  1. 19
      src/App.js
  2. 14
      src/package.json

19
src/App.js

@ -3,7 +3,7 @@ import { NavigationContainer } from "@react-navigation/native";
import navigationTheme from "./app/navigation/navigationTheme";
import "./app/config/globals.js";
import AppLoading from "expo-app-loading";
import * as SplashScreen from 'expo-splash-screen';
import FlashMessage, {
showMessage,
hideMessage,
@ -26,6 +26,9 @@ import { connect } from "formik";
import colors from "./app/config/colors";
import { dimensions } from "./app/config/dimensions";
SplashScreen.preventAutoHideAsync();
export default function App() {
const [user, setUser] = useState();
const [pluviometerStation, setPluviometerStation] = useState(undefined);
@ -103,22 +106,17 @@ export default function App() {
}
}, [pluviometerStation]);
useEffect(()=>{
const restoreUser = async () => {
const storageUser = await authStorage.getUser();
if (storageUser) setUser(storageUser);
global.location = await getLocation();
SplashScreen.hideAsync();
};
restoreUser()
})
if (!isReady) {
return (
<AppLoading
startAsync={restoreUser}
onFinish={() => setIsReady(true)}
onError={(e) => console.log(e)}
/>
);
} else {
if (global.formsSockets === undefined)
global.formsSockets = useFiltering(
global.location || global.defaultLocation
@ -143,5 +141,4 @@ export default function App() {
</CurrentLocationProvider>
</AuthContext.Provider>
);
}
}

14
src/package.json

@ -30,13 +30,14 @@
"eslint": "^8.1.0",
"eslint-plugin-react": "^7.26.1",
"expo": "^49.0.0",
"expo-app-loading": "~1.2.1",
"expo-app-loading": "^2.1.1",
"expo-asset": "~8.10.1",
"expo-file-system": "~15.4.4",
"expo-image-picker": "~14.3.2",
"expo-location": "~16.1.0",
"expo-permissions": "~14.2.1",
"expo-secure-store": "~12.3.1",
"expo-splash-screen": "~0.20.5",
"expo-sqlite": "~11.3.3",
"expo-status-bar": "~1.6.0",
"formik": "^2.2.9",
@ -67,7 +68,6 @@
"react-native-simple-dialogs": "^1.4.0",
"react-native-svg": "13.9.0",
"react-native-svg-transformer": "^0.14.3",
"react-native-svg-uri": "^1.2.3",
"react-native-walkthrough-tooltip": "^1.3.0",
"react-native-web": "~0.19.6",
"react-native-webview": "13.2.2",
@ -84,5 +84,15 @@
"@babel/core": "^7.12.9",
"jest-expo": "^43.0.0"
},
"overrides": {
"@expo/config-plugins": "~7.2.2",
"@expo/prebuild-config": "~6.2.4",
"expo-modules-autolinking": "~1.5.0"
},
"resolutions": {
"@expo/config-plugins": "~7.2.2",
"@expo/prebuild-config": "~6.2.4",
"expo-modules-autolinking": "~1.5.0"
},
"private": true
}
Loading…
Cancel
Save