How to bridge React Native Promise to Swift

Taken from the answers at Got "is not a recognized Objective-C method" when bridging Swift to React-Native; the fact that it doesn't work, is because of the difference in the first argument labels.

To make it work with your initial code you should write the first argument of your Swift to be without a name, like this:

@objc
func loginWithEmail(_ resolve: RCTPromiseResolveBlock, rejecter reject: RCTPromiseRejectBlock) -> Void {
    //   the trick  ^
    resolve("This method is no longer troublesome")
}

Adding so that the complete solution is shown

.m - note that the resolve parameter is not "named"

RCT_EXTERN_METHOD(loginWithEmail: (RCTPromiseResolveBlock)resolve
                                  rejecter:(RCTPromiseRejectBlock)reject)

.swift - same as @Koen

@objc func loginWithEmail(_ resolve: @escaping RCTPromiseResolveBlock,
                            rejecter reject: @escaping RCTPromiseRejectBlock ) -> Void {}