diff --git a/src/js/client.ts b/src/js/client.ts index a76163e1ba..cef7a6d3fd 100644 --- a/src/js/client.ts +++ b/src/js/client.ts @@ -25,14 +25,14 @@ export class ReactNativeClient extends BaseClient { * @param options Configuration options for this SDK. */ public constructor(options: ReactNativeClientOptions) { - const transport = (options: BrowserTransportOptions, nativeFetch?: FetchImpl): Transport => { - if (NATIVE.isNativeTransportAvailable()) { - return new NativeTransport(); - } - return makeFetchTransport(options, nativeFetch); + if (!options.transport) { + options.transport = (options: BrowserTransportOptions, nativeFetch?: FetchImpl): Transport => { + if (NATIVE.isNativeTransportAvailable()) { + return new NativeTransport(); + } + return makeFetchTransport(options, nativeFetch); + }; } - - options.transport = transport; super(options); // This is a workaround for now using fetch on RN, this is a known issue in react-native and only generates a warning