Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 11 additions & 1 deletion ios/ReactNativeBrownfield.swift
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ internal import ReactAppDependencyProvider
class ReactNativeBrownfieldDelegate: RCTDefaultReactNativeFactoryDelegate {
var entryFile = "index"
var bundlePath = "main.jsbundle"
var bundle = Bundle.main
// MARK: - RCTReactNativeFactoryDelegate Methods

override func sourceURL(for bridge: RCTBridge) -> URL? {
Expand All @@ -21,7 +22,7 @@ class ReactNativeBrownfieldDelegate: RCTDefaultReactNativeFactoryDelegate {
let resourceName = withoutLast.joined()
let fileExtension = resourceURLComponents.last ?? ""

return Bundle.main.url(forResource: resourceName, withExtension: fileExtension)
return bundle.url(forResource: resourceName, withExtension: fileExtension)
#endif
}
}
Expand Down Expand Up @@ -54,6 +55,15 @@ class ReactNativeBrownfieldDelegate: RCTDefaultReactNativeFactoryDelegate {
delegate.bundlePath = bundlePath
}
}
/**
* Bundle instance to lookup the JavaScript bundle.
* Default value: Bundle.main
*/
@objc public var bundle: Bundle = Bundle.main {
didSet {
delegate.bundle = bundle
}
}
/**
* React Native factory instance created when starting React Native.
* Default value: nil
Expand Down
Loading