I am currently using packages:
react-native-bootsplash: 6.3.3
@react-navigation/native: 7.0.14
react-native: 0.75.4
All configuration is set up according to react-native-bootsplash
's docs
ios\<my-project-name>\AppDelegate.mm
#import "AppDelegate.h"
#import "RNBootSplash.h"
#import <React/RCTBundleURLProvider.h>
@implementation AppDelegate
// other code ...
- (void)customizeRootView:(RCTRootView *)rootView {
[super customizeRootView:rootView];
[RNBootSplash initWithStoryboard:@"BootSplash" rootView:rootView];
}
@end
android\app\src\main\java\com\<my-project-name>\MainActivity.kt
// other import ...
import android.os.Bundle;
import com.zoontek.rnbootsplash.RNBootSplash
class MainActivity : ReactActivity() {
override fun onCreate(savedInstanceState: Bundle?) {
RNBootSplash.init(this, R.style.BootTheme)
super.onCreate(null)
}
// other methods
}
src\App.jsx
import React from 'react';
import { NavigationContainer } from '@react-navigation/native';
import BootSplash from 'react-native-bootsplash';
import RootBottomTab from './navigation/RootBottomTab';
function App() {
const onReady = React.useCallback(
async () => await BootSplash.hide({ fade: true }),
[],
);
return (
<NavigationContainer onReady={onReady}>
<RootBottomTab />
</NavigationContainer>
);
}
export default React.memo(App);
When I run the command
npx react-native-bootsplash generate <my-logo-path> --platforms=android,ios
I see a directory assets/bootsplash
is created in my project by flag --assets-output <string>
with default path "assets/bootsplash"
. I try to remove assets/bootsplash
and my app works fine, nothing wrong, at least on Android device.
I feel that assets/bootsplash
is an intermediary resource. When all resources are generated by npx react-native-bootsplash generate
and the process is complete. Therefore, it is not necessary to push assets/bootsplash
to source control, such as GitHub.
I have some questions:
- Should I remove
assets/bootsplash
? - If I remove, will it affect the
ios
project?
If you need any more information about my project, please let me know.