How do I write flavor specifc code in react-native?

In 2019 I joined the programming community and started studying js, nodejs and react-native. About a week ago I starded developing a white-label app, where just some images, colors and api calls will differ from app to app, so the last couple of days I tryied to learn how to build multiple apps from the sabe project… (lets mainly focus on Android here) thru my journey I found a few guides and I managed to make it work by following this guide and setting product flavors in my build.gradle.

    productFlavors {
    firstapp {
        minSdkVersion rootProject.ext.minSdkVersion
        applicationId 'com.firstapp'
        targetSdkVersion rootProject.ext.targetSdkVersion
        resValue "string", "build_config_package", "com.myapp"
    }
    secondapp {
        minSdkVersion rootProject.ext.minSdkVersion
        applicationId 'com.secondapp'
        targetSdkVersion rootProject.ext.targetSdkVersion
        resValue "string", "build_config_package", "com.myapp"
    }
}

But, as im quite a begginer, I couldnt find the proper way to write flavor specifc code for me to be able to call react-native run-android --variant=firstappDebug and latter on release gradlew assembleFirstappRelease and get everything that I need for that specific flavor/target.

In addition, I followed this other guide that more or less shows how to do that, but again, I lack knowledge to proper execute some steps so I failed there.

In conclusion… Im still studying hard to grow, but I felt the need to ask the community for help.