bamlab / react-native-make

A collection of everyday React Native CLI tools
MIT License
762 stars 89 forks source link

import is being duplicated in the set-splash command #66

Open joaosouz4dev opened 3 years ago

joaosouz4dev commented 3 years ago

in MainActivity.java this import is being duplicated in the set-splash command

import org.devio.rn.splashscreen.SplashScreen;
import com.facebook.react.ReactActivity;

I think it's this code that does this, is there a way to optimize?

./src/modules/setSplashScreen/android/service.ts

<!--StartFragment-->  
applyPatch(mainActivityPath, {    
  pattern: /^(.+?)(?=import)/gs,    
  patch: 'import android.os.Bundle;\n' + 'import org.devio.rn.splashscreen.SplashScreen;\n', 
});
<!--EndFragment-->