Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

React native: TypeError: null is not an object (evaluating 'SplashScreen.preventAutoHide') #7740

Closed
zeesulehria opened this issue Apr 8, 2020 · 3 comments

Comments

@zeesulehria
Copy link

zeesulehria commented Apr 8, 2020

馃悰 Bug Report

Getting this error after upgrading to latest expo, ejecting the project and run it from android-studio

WhatsApp Image 2020-04-08 at 7 01 08 PM

Environment

expo": "~37.0.3",
"expo-analytics-segment": "^8.1.0",
"expo-asset": "^8.1.4",
"expo-av": "^8.1.0",
"expo-constants": "^9.0.0",
"expo-font": "^8.1.0",
"expo-image-picker": "^8.1.0",
"expo-permissions": "^8.1.0",
"expo-splash-screen": "^0.2.0",
"expo-updates": "~0.1.0",
"expo-video-player": "^1.5.7",
"expokit": "^37.0.0",
"native-base": "2.13.8",
"react": "~16.9.0",
"react-dom": "~16.9.0",
"react-native": "~0.61.5",

Steps to Reproduce

Expected Behavior

Actual Behavior

Reproducible Demo

@andrekovac
Copy link
Contributor

I get the same issue when trying to run on iOS or Android. Another user on StackOverflow also posted the same issue: https://stackoverflow.com/questions/61067070/

Eject an Expo project with Expo version 37 and then try to run it. No SplashScreen is imported anywhere in the App.

@cruzach
Copy link
Contributor

cruzach commented Apr 8, 2020

As the answer states in the SO link shared above, AppLoading is not available in the bare workflow,

To achieve the same behavior in AppLoading, all you need to do is to follow the examples section in expo-splash-screen README. Using the SplashScreen API directly gives you more control over what's happening in your app

@andrekovac
Copy link
Contributor

The SO link doesn't explicitly mention the AppLoading component. I added an answer there to clarify it.

andrekovac added a commit to andrekovac/expo that referenced this issue Apr 9, 2020
The issue of not having the `AppLoading` component available in the bare workflow was raised in expo#7718 and expo#7740 . This new example helps people switching from a managed workflow to refactor their `App.tsx` file.

Furthermore, the current examples only include `App.tsx` as class components whereas `App.tsx` in the current Expo templates all use a functional component and hooks. Hence, this example uses a functional component and hooks to look more familiar to new Expo users.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants