Check out example codes for "how to start on a programatic view swift". It will help you in understanding the concepts better.

Code Example 1

func scene(_ scene: UIScene, willConnectTo session: UISceneSession, options connectionOptions: UIScene.ConnectionOptions) {    
    guard let winScene = (scene as? UIWindowScene) else { return }
    window = UIWindow(windowScene: winScene)
    window?.rootViewController = ViewController()

Learn ReactJs, React Native from