Skip to content

Commit bde2fe2

Browse files
Remove sourceURL(for:) override — superseded by bundleURL() after legacy arch removal
The sourceURLForBridge: method will be removed from RCTBridgeDelegate in react/react-native#56831 due to the RCT_REMOVE_LEGACY_ARCH clean up. Then the override no longer overrides anything and fails Swift compilation. bundleURL() — already present below — is the replacement API on RCTReactNativeFactoryDelegate. This change depends on react/react-native#56974
1 parent 4b98aaf commit bde2fe2

1 file changed

Lines changed: 5 additions & 0 deletions

File tree

template/ios/HelloWorld/AppDelegate.swift

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,9 +34,14 @@ class AppDelegate: UIResponder, UIApplicationDelegate {
3434
}
3535

3636
class ReactNativeDelegate: RCTDefaultReactNativeFactoryDelegate {
37+
#if !RCT_REMOVE_LEGACY_ARCH
38+
// Required by `RCTBridgeDelegate` until the legacy architecture is fully
39+
// removed. On newer React Native versions this symbol no longer exists, so
40+
// the override is compiled out via SWIFT_ACTIVE_COMPILATION_CONDITIONS.
3741
override func sourceURL(for bridge: RCTBridge) -> URL? {
3842
self.bundleURL()
3943
}
44+
#endif
4045

4146
override func bundleURL() -> URL? {
4247
#if DEBUG

0 commit comments

Comments
 (0)