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
Using AppLoading in Bare Workflow results in confusing SplashScreen error #7718
Comments
in your node_modules/expo/build/launch/splashScreen.js change it to the following:
you should be golden |
@adamsolomon1986 weird, switched to that and put AppLoading back in and that seems to work (my fonts are loading!), but I feel like I shouldn't use that anyway since the docs say AppLoading is only for the managed workflow Also changed the function names since the ones without "...Async" are deprecated
(Also confused about the LaunchScreen.xib still showing on app start before the SplashScreen.storyboard (EDIT! Thought I changed my Launch Screen file to SplashScreen, guess I didn't)) |
I'm real confused by this situation as well. It seems like a doc bug or an Expo bug or both; I can't tell. The SDK 37 release notes say that the bare workflow now has feature parity with ExpoKit; that's clearly not the case if |
@raphaelrk, @brettdh @adamsolomon1986, I highly discourage anyone from modifying files in @raphaelrk, regarding |
@bbarthec thanks. For anyone stumbling across this, I found the example in the readme to be a bit lacking in terms of replicating the very simple AppLoading behavior that I was relying on:
This simple component replaced it nicely for my usage (with redux-persist const AppLoading = () => {
useEffect(() => {
SplashScreen.preventAutoHideAsync().catch(() => {});
return () => {
SplashScreen.hideAsync().catch(() => {});
};
});
return null;
};
// later
...
<PersistGate loading={<AppLoading />} ...>
...
</PersistGate>
... This may be obvious to others reading this, but since it's so simple, IMO it'd be useful to have as a bridge for folks moving from ExpoKit to bare with SDK 37. |
This issue is related to #7740 which hits people who newly eject to the bare workflow. The news that the |
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.
@Andruschenko It's documented on the Supported Expo SDK APIs page, at the bottom where they show which APIs are bare compatible only, and which are managed only. |
My eventual solution to showing and hiding the splash screen, though seems a little jank (e.g. maybe I should move hideAsync to a useEffect in App.js): App.js
In Root.js --
Edit/note: above code possibly runs into this issue in my release build, but I'm not sure (have some confounding bugs), and still getting a really short white flash |
Thanks 馃憤 |
there are also the modify like so : import { NativeModules } from 'react-native'; |
This issue is stale because it has been open for 60 days with no activity. If there is no activity in the next 7 days, the issue will be closed. |
This issue was closed because it has been inactive for 7 days since being marked as stale. Please open a new issue if you believe you are encountering a related problem. |
馃悰 Bug Report
Environment
iOS Bare Workflow. Targeting simulator. Run with Xcode or yarn ios.
Steps to Reproduce
Expected Behavior
Should get a warning that I'm using AppLoading in a Bare Workflow project when I can't
(Would also be nice if my App.js was mentioned in the redbox, as the flow of error being App.js > AppLoading > SplashScreen. Would also be nice if it was more prominent that AppLoading doesn't work in Bare Workflow, and how instead we should do Asset loading)
Actual Behavior
Get an error about SplashScreen being null (from which point I keep trying to debug splash screen, or think none of my native modules are loading, until realizing removing apploading fixes it)
For googlers:
Reproducible Demo
From the steps above: github repo
Related: #4845
Also slightly related: NativeModules empty object
The text was updated successfully, but these errors were encountered: