From 00c7f7467763e34707deb24ba8bfc22db5f21070 Mon Sep 17 00:00:00 2001 From: Joselito Lima Date: Tue, 24 Oct 2023 18:13:57 -0300 Subject: [PATCH] fixing ViewPropTypes error in the splash-screen and the expo-doctor error --- src/App.js | 77 +++++++++++++++++++++++------------------------- src/package.json | 14 +++++++-- 2 files changed, 49 insertions(+), 42 deletions(-) diff --git a/src/App.js b/src/App.js index 7940489..26b92f1 100644 --- a/src/App.js +++ b/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,45 +106,39 @@ export default function App() { } }, [pluviometerStation]); - const restoreUser = async () => { - const storageUser = await authStorage.getUser(); - if (storageUser) setUser(storageUser); - - global.location = await getLocation(); - }; - - if (!isReady) { - return ( - setIsReady(true)} - onError={(e) => console.log(e)} - /> + useEffect(()=>{ + const restoreUser = async () => { + const storageUser = await authStorage.getUser(); + if (storageUser) setUser(storageUser); + + global.location = await getLocation(); + SplashScreen.hideAsync(); + }; + restoreUser() + }) + + if (global.formsSockets === undefined) + global.formsSockets = useFiltering( + global.location || global.defaultLocation ); - } else { - if (global.formsSockets === undefined) - global.formsSockets = useFiltering( - global.location || global.defaultLocation - ); - return ( - - - - - - {user ? : } - - - - - - - ); - } + return ( + + + + + + {user ? : } + + + + + + + ); } diff --git a/src/package.json b/src/package.json index 6385b34..f2db27d 100644 --- a/src/package.json +++ b/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 }