expo 55.0.0-canary-20260119-17896bf → 55.0.0-canary-20260120-bb71700
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/Expo.podspec +1 -0
- package/android/build.gradle +5 -5
- package/android/src/main/java/expo/modules/ExpoReactHostFactory.kt +67 -32
- package/android/src/main/java/expo/modules/ReactActivityDelegateWrapper.kt +6 -9
- package/android/src/main/java/expo/modules/fetch/ExpoFetchModule.kt +4 -3
- package/android/src/main/java/expo/modules/fetch/NativeResponse.kt +3 -3
- package/android/src/main/java/expo/modules/fetch/ResponseSink.kt +7 -3
- package/android/src/test/java/expo/modules/ReactActivityDelegateWrapperDelayLoadTest.kt +2 -3
- package/build/Expo.d.ts +1 -1
- package/build/Expo.d.ts.map +1 -1
- package/build/async-require/buildErrors.d.ts +5 -0
- package/build/async-require/buildErrors.d.ts.map +1 -0
- package/build/async-require/getDevServer.d.ts.map +1 -1
- package/build/async-require/getFullBundlerUrl.d.ts +2 -0
- package/build/async-require/getFullBundlerUrl.d.ts.map +1 -0
- package/build/async-require/hmr.d.ts +8 -8
- package/build/async-require/hmr.d.ts.map +1 -1
- package/build/async-require/hmrUtils.d.ts +13 -0
- package/build/async-require/hmrUtils.d.ts.map +1 -0
- package/build/async-require/hmrUtils.native.d.ts +13 -0
- package/build/async-require/hmrUtils.native.d.ts.map +1 -0
- package/build/dom/dom-entry.d.ts.map +1 -1
- package/build/dom/dom-internal.types.d.ts +11 -0
- package/build/dom/dom-internal.types.d.ts.map +1 -0
- package/build/dom/dom.types.d.ts +5 -0
- package/build/dom/dom.types.d.ts.map +1 -1
- package/build/dom/internal.d.ts +1 -0
- package/build/dom/internal.d.ts.map +1 -1
- package/build/dom/webview-wrapper.d.ts +2 -2
- package/build/dom/webview-wrapper.d.ts.map +1 -1
- package/build/hooks/useEvent.d.ts +2 -2
- package/bundledNativeModules.json +99 -101
- package/ios/AppDelegates/AppDelegatesLoaderDelegate.swift +2 -0
- package/ios/AppDelegates/EXReactRootViewFactory.h +8 -1
- package/ios/AppDelegates/EXReactRootViewFactory.mm +26 -0
- package/ios/AppDelegates/ExpoAppDelegate.swift +14 -55
- package/ios/AppDelegates/ExpoReactNativeFactory.h +12 -0
- package/ios/AppDelegates/ExpoReactNativeFactory.mm +45 -0
- package/ios/AppDelegates/ExpoReactNativeFactory.swift +22 -1
- package/ios/Expo.h +2 -1
- package/ios/Fetch/ExpoFetchModule.swift +2 -2
- package/local-build-cache-provider.d.ts +1 -0
- package/local-build-cache-provider.js +1 -0
- package/package.json +29 -23
- package/src/Expo.fx.tsx +1 -25
- package/src/Expo.fx.web.tsx +2 -2
- package/src/Expo.ts +3 -0
- package/src/__tests__/__fbBatchedBridgeConfig-test.ts +7 -3
- package/src/async-require/asyncRequireModule.ts +2 -2
- package/src/async-require/buildErrors.ts +14 -0
- package/src/async-require/getDevServer.ts +3 -9
- package/src/async-require/getFullBundlerUrl.ts +13 -0
- package/src/async-require/hmr.ts +118 -103
- package/src/async-require/hmrUtils.native.ts +97 -0
- package/src/async-require/hmrUtils.ts +54 -0
- package/src/async-require/index.ts +1 -1
- package/src/async-require/setupFastRefresh.ts +3 -2
- package/src/dom/dom-entry.tsx +15 -8
- package/src/dom/dom-internal.types.ts +9 -0
- package/src/dom/dom.types.ts +6 -0
- package/src/dom/internal.ts +2 -0
- package/src/dom/webview-wrapper.tsx +14 -6
- package/src/hooks/useEvent.ts +2 -2
- package/template.tgz +0 -0
- package/types/react-native-web.d.ts +1 -1
- package/android/src/main/java/expo/modules/ReactNativeHostWrapper.kt +0 -51
- package/android/src/main/java/expo/modules/ReactNativeHostWrapperBase.kt +0 -107
- package/build/async-require/hmr.native.d.ts +0 -3
- package/build/async-require/hmr.native.d.ts.map +0 -1
- package/ios/AppDelegates/EXAppDelegateWrapper.h +0 -30
- package/ios/AppDelegates/EXAppDelegateWrapper.mm +0 -112
- package/src/async-require/hmr.native.ts +0 -3
package/Expo.podspec
CHANGED
package/android/build.gradle
CHANGED
|
@@ -32,7 +32,7 @@ buildscript {
|
|
|
32
32
|
def reactNativeVersion = project.extensions.getByType(ExpoModuleExtension).reactNativeVersion
|
|
33
33
|
|
|
34
34
|
group = 'host.exp.exponent'
|
|
35
|
-
version = '55.0.0-canary-
|
|
35
|
+
version = '55.0.0-canary-20260120-bb71700'
|
|
36
36
|
|
|
37
37
|
expoModule {
|
|
38
38
|
// We can't prebuild the module because it depends on the generated files.
|
|
@@ -43,7 +43,7 @@ android {
|
|
|
43
43
|
namespace "expo.core"
|
|
44
44
|
defaultConfig {
|
|
45
45
|
versionCode 1
|
|
46
|
-
versionName "55.0.0-canary-
|
|
46
|
+
versionName "55.0.0-canary-20260120-bb71700"
|
|
47
47
|
consumerProguardFiles("proguard-rules.pro")
|
|
48
48
|
}
|
|
49
49
|
testOptions {
|
|
@@ -78,11 +78,11 @@ dependencies { dependencyHandler ->
|
|
|
78
78
|
implementation 'com.facebook.react:react-android'
|
|
79
79
|
|
|
80
80
|
testImplementation 'junit:junit:4.13.2'
|
|
81
|
-
testImplementation 'androidx.test:core:1.5.0'
|
|
82
|
-
testImplementation "com.google.truth:truth:1.1.2"
|
|
83
81
|
testImplementation 'io.mockk:mockk:1.13.5'
|
|
82
|
+
testImplementation 'androidx.test:core:1.7.0'
|
|
83
|
+
testImplementation "com.google.truth:truth:1.4.5"
|
|
84
84
|
testImplementation 'org.jetbrains.kotlinx:kotlinx-coroutines-test:1.10.2'
|
|
85
|
-
testImplementation 'org.robolectric:robolectric:4.
|
|
85
|
+
testImplementation 'org.robolectric:robolectric:4.16'
|
|
86
86
|
|
|
87
87
|
if (useLegacyAutolinking) {
|
|
88
88
|
// Link expo modules as dependencies of the adapter. It uses `api` configuration so they all will be visible for the app as well.
|
|
@@ -5,12 +5,12 @@ package expo.modules
|
|
|
5
5
|
import android.content.Context
|
|
6
6
|
import com.facebook.react.ReactHost
|
|
7
7
|
import com.facebook.react.ReactInstanceEventListener
|
|
8
|
-
import com.facebook.react.ReactNativeHost
|
|
9
8
|
import com.facebook.react.ReactPackage
|
|
10
9
|
import com.facebook.react.ReactPackageTurboModuleManagerDelegate
|
|
11
10
|
import com.facebook.react.bridge.JSBundleLoader
|
|
12
11
|
import com.facebook.react.bridge.ReactContext
|
|
13
12
|
import com.facebook.react.common.annotations.UnstableReactNativeAPI
|
|
13
|
+
import com.facebook.react.common.build.ReactBuildConfig
|
|
14
14
|
import com.facebook.react.defaults.DefaultComponentsRegistry
|
|
15
15
|
import com.facebook.react.defaults.DefaultTurboModuleManagerDelegate
|
|
16
16
|
import com.facebook.react.fabric.ComponentFactory
|
|
@@ -19,6 +19,7 @@ import com.facebook.react.runtime.JSRuntimeFactory
|
|
|
19
19
|
import com.facebook.react.runtime.ReactHostDelegate
|
|
20
20
|
import com.facebook.react.runtime.ReactHostImpl
|
|
21
21
|
import com.facebook.react.runtime.hermes.HermesInstance
|
|
22
|
+
import expo.modules.core.interfaces.ReactNativeHostHandler
|
|
22
23
|
import java.lang.ref.WeakReference
|
|
23
24
|
|
|
24
25
|
object ExpoReactHostFactory {
|
|
@@ -27,12 +28,35 @@ object ExpoReactHostFactory {
|
|
|
27
28
|
@UnstableReactNativeAPI
|
|
28
29
|
private class ExpoReactHostDelegate(
|
|
29
30
|
private val weakContext: WeakReference<Context>,
|
|
30
|
-
private val
|
|
31
|
+
private val packageList: List<ReactPackage>,
|
|
32
|
+
override val jsMainModulePath: String,
|
|
33
|
+
private val jsBundleAssetPath: String?,
|
|
34
|
+
private val jsBundleFilePath: String? = null,
|
|
35
|
+
private val useDevSupport: Boolean,
|
|
31
36
|
override val bindingsInstaller: BindingsInstaller? = null,
|
|
32
37
|
override val turboModuleManagerDelegateBuilder: ReactPackageTurboModuleManagerDelegate.Builder =
|
|
33
|
-
DefaultTurboModuleManagerDelegate.Builder()
|
|
38
|
+
DefaultTurboModuleManagerDelegate.Builder(),
|
|
39
|
+
private val hostHandlers: List<ReactNativeHostHandler>
|
|
34
40
|
) : ReactHostDelegate {
|
|
35
41
|
|
|
42
|
+
val hostDelegateJsBundleFilePath: String?
|
|
43
|
+
get() =
|
|
44
|
+
hostHandlers.asSequence()
|
|
45
|
+
.mapNotNull { it.getJSBundleFile(useDevSupport) }
|
|
46
|
+
.firstOrNull() ?: jsBundleFilePath
|
|
47
|
+
|
|
48
|
+
val hostDelegateJSBundleAssetPath: String?
|
|
49
|
+
get() =
|
|
50
|
+
hostHandlers.asSequence()
|
|
51
|
+
.mapNotNull { it.getBundleAssetName(useDevSupport) }
|
|
52
|
+
.firstOrNull() ?: jsBundleAssetPath
|
|
53
|
+
|
|
54
|
+
val hostDelegateUseDeveloperSupport: Boolean
|
|
55
|
+
get() =
|
|
56
|
+
hostHandlers.asSequence()
|
|
57
|
+
.mapNotNull { it.useDeveloperSupport }
|
|
58
|
+
.firstOrNull() ?: useDevSupport
|
|
59
|
+
|
|
36
60
|
// Keeps this `_jsBundleLoader` backing property for DevLauncher to replace its internal value
|
|
37
61
|
private var _jsBundleLoader: JSBundleLoader? = null
|
|
38
62
|
override val jsBundleLoader: JSBundleLoader
|
|
@@ -41,74 +65,85 @@ object ExpoReactHostFactory {
|
|
|
41
65
|
if (backingJSBundleLoader != null) {
|
|
42
66
|
return backingJSBundleLoader
|
|
43
67
|
}
|
|
44
|
-
val context = weakContext.get()
|
|
45
|
-
|
|
68
|
+
val context = weakContext.get()
|
|
69
|
+
?: throw IllegalStateException("Unable to get concrete Context")
|
|
70
|
+
hostDelegateJsBundleFilePath?.let { jsBundleFile ->
|
|
46
71
|
if (jsBundleFile.startsWith("assets://")) {
|
|
47
72
|
return JSBundleLoader.createAssetLoader(context, jsBundleFile, true)
|
|
48
73
|
}
|
|
49
74
|
return JSBundleLoader.createFileLoader(jsBundleFile)
|
|
50
75
|
}
|
|
51
|
-
val jsBundleAssetPath = reactNativeHostWrapper.bundleAssetName
|
|
52
|
-
return JSBundleLoader.createAssetLoader(context, "assets://$jsBundleAssetPath", true)
|
|
53
|
-
}
|
|
54
76
|
|
|
55
|
-
|
|
56
|
-
|
|
77
|
+
return JSBundleLoader.createAssetLoader(context, "assets://$hostDelegateJSBundleAssetPath", true)
|
|
78
|
+
}
|
|
57
79
|
|
|
58
80
|
override val jsRuntimeFactory: JSRuntimeFactory
|
|
59
81
|
get() = HermesInstance()
|
|
60
82
|
|
|
61
83
|
override val reactPackages: List<ReactPackage>
|
|
62
|
-
get() =
|
|
84
|
+
get() = packageList
|
|
63
85
|
|
|
64
86
|
override fun handleInstanceException(error: Exception) {
|
|
65
|
-
|
|
66
|
-
if (handlers.isEmpty()) {
|
|
87
|
+
if (hostHandlers.isEmpty()) {
|
|
67
88
|
throw error
|
|
68
89
|
}
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
handler.onReactInstanceException(useDeveloperSupport, error)
|
|
90
|
+
hostHandlers.forEach { handler ->
|
|
91
|
+
handler.onReactInstanceException(hostDelegateUseDeveloperSupport, error)
|
|
72
92
|
}
|
|
73
93
|
}
|
|
74
94
|
}
|
|
75
95
|
|
|
76
96
|
@OptIn(UnstableReactNativeAPI::class)
|
|
77
97
|
@JvmStatic
|
|
78
|
-
fun
|
|
98
|
+
fun getDefaultReactHost(
|
|
79
99
|
context: Context,
|
|
80
|
-
|
|
100
|
+
packageList: List<ReactPackage>,
|
|
101
|
+
jsMainModulePath: String = ".expo/.virtual-metro-entry",
|
|
102
|
+
jsBundleAssetPath: String = "index.android.bundle",
|
|
103
|
+
jsBundleFilePath: String? = null,
|
|
104
|
+
jsRuntimeFactory: JSRuntimeFactory? = null,
|
|
105
|
+
useDevSupport: Boolean = ReactBuildConfig.DEBUG,
|
|
106
|
+
bindingsInstaller: BindingsInstaller? = null
|
|
81
107
|
): ReactHost {
|
|
82
|
-
require(reactNativeHost is ReactNativeHostWrapper) {
|
|
83
|
-
"You can call createFromReactNativeHost only with instances of ReactNativeHostWrapper"
|
|
84
|
-
}
|
|
85
108
|
if (reactHost == null) {
|
|
86
|
-
val
|
|
87
|
-
|
|
109
|
+
val hostHandlers = ExpoModulesPackage.packageList
|
|
110
|
+
.flatMap { it.createReactNativeHostHandlers(context) }
|
|
111
|
+
|
|
112
|
+
val reactHostDelegate = ExpoReactHostDelegate(
|
|
113
|
+
WeakReference(context),
|
|
114
|
+
packageList,
|
|
115
|
+
jsMainModulePath,
|
|
116
|
+
jsBundleAssetPath,
|
|
117
|
+
jsBundleFilePath,
|
|
118
|
+
useDevSupport,
|
|
119
|
+
bindingsInstaller,
|
|
120
|
+
hostHandlers = hostHandlers
|
|
121
|
+
)
|
|
88
122
|
val componentFactory = ComponentFactory()
|
|
89
123
|
DefaultComponentsRegistry.register(componentFactory)
|
|
90
124
|
|
|
91
|
-
|
|
92
|
-
handler.onWillCreateReactInstance(
|
|
125
|
+
hostHandlers.forEach { handler ->
|
|
126
|
+
handler.onWillCreateReactInstance(useDevSupport)
|
|
93
127
|
}
|
|
94
128
|
|
|
95
129
|
val reactHostImpl =
|
|
96
130
|
ReactHostImpl(
|
|
97
131
|
context,
|
|
98
|
-
reactHostDelegate,
|
|
99
|
-
componentFactory,
|
|
100
|
-
true,
|
|
101
|
-
|
|
132
|
+
delegate = reactHostDelegate,
|
|
133
|
+
componentFactory = componentFactory,
|
|
134
|
+
allowPackagerServerAccess = true,
|
|
135
|
+
useDevSupport = useDevSupport
|
|
102
136
|
)
|
|
103
137
|
|
|
104
|
-
|
|
138
|
+
hostHandlers.forEach { handler ->
|
|
139
|
+
handler.onDidCreateReactHost(context, reactHostImpl)
|
|
105
140
|
handler.onDidCreateDevSupportManager(reactHostImpl.devSupportManager)
|
|
106
141
|
}
|
|
107
142
|
|
|
108
143
|
reactHostImpl.addReactInstanceEventListener(object : ReactInstanceEventListener {
|
|
109
144
|
override fun onReactContextInitialized(context: ReactContext) {
|
|
110
|
-
|
|
111
|
-
handler.onDidCreateReactInstance(
|
|
145
|
+
hostHandlers.forEach { handler ->
|
|
146
|
+
handler.onDidCreateReactInstance(useDevSupport, context)
|
|
112
147
|
}
|
|
113
148
|
}
|
|
114
149
|
})
|
|
@@ -21,7 +21,6 @@ import com.facebook.react.ReactDelegate
|
|
|
21
21
|
import com.facebook.react.ReactHost
|
|
22
22
|
import com.facebook.react.ReactInstanceEventListener
|
|
23
23
|
import com.facebook.react.ReactInstanceManager
|
|
24
|
-
import com.facebook.react.ReactNativeHost
|
|
25
24
|
import com.facebook.react.ReactRootView
|
|
26
25
|
import com.facebook.react.bridge.ReactContext
|
|
27
26
|
import com.facebook.react.modules.core.PermissionListener
|
|
@@ -55,15 +54,12 @@ class ReactActivityDelegateWrapper(
|
|
|
55
54
|
private val reactActivityHandlers = ExpoModulesPackage.packageList
|
|
56
55
|
.flatMap { it.createReactActivityHandlers(activity) }
|
|
57
56
|
private val methodMap: ArrayMap<String, Method> = ArrayMap()
|
|
58
|
-
private val _reactNativeHost: ReactNativeHost by lazy {
|
|
59
|
-
invokeDelegateMethod("getReactNativeHost")
|
|
60
|
-
}
|
|
61
57
|
private val _reactHost: ReactHost? by lazy {
|
|
62
58
|
delegate.reactHost
|
|
63
59
|
}
|
|
64
60
|
private val delayLoadAppHandler: DelayLoadAppHandler? by lazy {
|
|
65
61
|
reactActivityHandlers.asSequence()
|
|
66
|
-
.mapNotNull { it.getDelayLoadAppHandler(activity,
|
|
62
|
+
.mapNotNull { it.getDelayLoadAppHandler(activity, reactHost) }
|
|
67
63
|
.firstOrNull()
|
|
68
64
|
}
|
|
69
65
|
|
|
@@ -102,10 +98,6 @@ class ReactActivityDelegateWrapper(
|
|
|
102
98
|
return invokeDelegateMethod("getReactDelegate")
|
|
103
99
|
}
|
|
104
100
|
|
|
105
|
-
override fun getReactNativeHost(): ReactNativeHost {
|
|
106
|
-
return _reactNativeHost
|
|
107
|
-
}
|
|
108
|
-
|
|
109
101
|
override fun getReactHost(): ReactHost? {
|
|
110
102
|
return _reactHost
|
|
111
103
|
}
|
|
@@ -131,6 +123,11 @@ class ReactActivityDelegateWrapper(
|
|
|
131
123
|
val newDelegate = reactActivityHandlers.asSequence()
|
|
132
124
|
.mapNotNull { it.onDidCreateReactActivityDelegate(activity, this) }
|
|
133
125
|
.firstOrNull()
|
|
126
|
+
|
|
127
|
+
reactActivityHandlers.forEach { handler ->
|
|
128
|
+
handler.onDidCreateReactActivityDelegateNotification(activity, newDelegate)
|
|
129
|
+
}
|
|
130
|
+
|
|
134
131
|
if (newDelegate != null && newDelegate != this) {
|
|
135
132
|
val mDelegateField = ReactActivity::class.java.getDeclaredField("mDelegate")
|
|
136
133
|
mDelegateField.isAccessible = true
|
|
@@ -11,6 +11,7 @@ import expo.modules.core.errors.ModuleDestroyedException
|
|
|
11
11
|
import expo.modules.kotlin.Promise
|
|
12
12
|
import expo.modules.kotlin.exception.Exceptions
|
|
13
13
|
import expo.modules.kotlin.exception.toCodedException
|
|
14
|
+
import expo.modules.kotlin.jni.NativeArrayBuffer
|
|
14
15
|
import expo.modules.kotlin.modules.Module
|
|
15
16
|
import expo.modules.kotlin.modules.ModuleDefinition
|
|
16
17
|
import kotlinx.coroutines.CoroutineName
|
|
@@ -97,14 +98,14 @@ class ExpoFetchModule : Module() {
|
|
|
97
98
|
|
|
98
99
|
AsyncFunction("arrayBuffer") { response: NativeResponse, promise: Promise ->
|
|
99
100
|
response.waitForStates(listOf(ResponseState.BODY_COMPLETED)) {
|
|
100
|
-
val data = response.sink.finalize()
|
|
101
|
-
promise.resolve(data)
|
|
101
|
+
val data = response.sink.finalize(directBuffer = true)
|
|
102
|
+
promise.resolve(NativeArrayBuffer(data))
|
|
102
103
|
}
|
|
103
104
|
}
|
|
104
105
|
|
|
105
106
|
AsyncFunction("text") { response: NativeResponse, promise: Promise ->
|
|
106
107
|
response.waitForStates(listOf(ResponseState.BODY_COMPLETED)) {
|
|
107
|
-
val data = response.sink.finalize()
|
|
108
|
+
val data = response.sink.finalize(directBuffer = false).array()
|
|
108
109
|
val text = data.toString(Charsets.UTF_8)
|
|
109
110
|
promise.resolve(text)
|
|
110
111
|
}
|
|
@@ -40,7 +40,7 @@ internal class NativeResponse(appContext: AppContext, private val coroutineScope
|
|
|
40
40
|
get() = this.sink.bodyUsed
|
|
41
41
|
|
|
42
42
|
override fun deallocate() {
|
|
43
|
-
this.sink.finalize()
|
|
43
|
+
this.sink.finalize(directBuffer = false)
|
|
44
44
|
super.deallocate()
|
|
45
45
|
}
|
|
46
46
|
|
|
@@ -57,10 +57,10 @@ internal class NativeResponse(appContext: AppContext, private val coroutineScope
|
|
|
57
57
|
}
|
|
58
58
|
if (state == ResponseState.RESPONSE_RECEIVED) {
|
|
59
59
|
state = ResponseState.BODY_STREAMING_STARTED
|
|
60
|
-
val queuedData = this.sink.finalize()
|
|
60
|
+
val queuedData = this.sink.finalize(directBuffer = false).array()
|
|
61
61
|
emit("didReceiveResponseData", queuedData)
|
|
62
62
|
} else if (state == ResponseState.BODY_COMPLETED) {
|
|
63
|
-
val queuedData = this.sink.finalize()
|
|
63
|
+
val queuedData = this.sink.finalize(directBuffer = false).array()
|
|
64
64
|
return queuedData
|
|
65
65
|
}
|
|
66
66
|
return null
|
|
@@ -15,15 +15,19 @@ internal class ResponseSink {
|
|
|
15
15
|
bodyQueue.add(data)
|
|
16
16
|
}
|
|
17
17
|
|
|
18
|
-
fun finalize():
|
|
18
|
+
fun finalize(directBuffer: Boolean): ByteBuffer {
|
|
19
19
|
val size = bodyQueue.sumOf { it.size }
|
|
20
|
-
val byteBuffer =
|
|
20
|
+
val byteBuffer = if (directBuffer) {
|
|
21
|
+
ByteBuffer.allocateDirect(size)
|
|
22
|
+
} else {
|
|
23
|
+
ByteBuffer.allocate(size)
|
|
24
|
+
}
|
|
21
25
|
for (byteArray in bodyQueue) {
|
|
22
26
|
byteBuffer.put(byteArray)
|
|
23
27
|
}
|
|
24
28
|
bodyQueue.clear()
|
|
25
29
|
bodyUsed = true
|
|
26
30
|
isFinalized = true
|
|
27
|
-
return byteBuffer
|
|
31
|
+
return byteBuffer
|
|
28
32
|
}
|
|
29
33
|
}
|
|
@@ -7,12 +7,12 @@ import com.facebook.react.ReactActivity
|
|
|
7
7
|
import com.facebook.react.ReactActivityDelegate
|
|
8
8
|
import com.facebook.react.ReactApplication
|
|
9
9
|
import com.facebook.react.ReactHost
|
|
10
|
-
import com.facebook.react.ReactNativeHost
|
|
11
10
|
import com.facebook.react.ReactRootView
|
|
12
11
|
import com.facebook.react.defaults.DefaultNewArchitectureEntryPoint.fabricEnabled
|
|
13
12
|
import com.facebook.react.defaults.DefaultReactActivityDelegate
|
|
14
13
|
import com.facebook.react.interfaces.fabric.ReactSurface
|
|
15
14
|
import com.facebook.react.internal.featureflags.ReactNativeFeatureFlags
|
|
15
|
+
import com.facebook.react.internal.featureflags.ReactNativeFeatureFlagsForTests
|
|
16
16
|
import com.facebook.soloader.SoLoader
|
|
17
17
|
import expo.modules.core.interfaces.Package
|
|
18
18
|
import expo.modules.core.interfaces.ReactActivityHandler
|
|
@@ -59,6 +59,7 @@ internal class ReactActivityDelegateWrapperDelayLoadTest {
|
|
|
59
59
|
fun setUp() {
|
|
60
60
|
SoLoader.setInTestMode()
|
|
61
61
|
mockkObject(ExpoModulesPackage.Companion)
|
|
62
|
+
ReactNativeFeatureFlagsForTests.setUp()
|
|
62
63
|
mockkStatic(ReactNativeFeatureFlags::class)
|
|
63
64
|
every { ReactNativeFeatureFlags.enableBridgelessArchitecture() } returns true
|
|
64
65
|
every { ReactNativeFeatureFlags.enableFabricRenderer() } returns true
|
|
@@ -251,8 +252,6 @@ internal class MockApplication : Application(), ReactApplication {
|
|
|
251
252
|
currentActivity = activity
|
|
252
253
|
}
|
|
253
254
|
|
|
254
|
-
override val reactNativeHost: ReactNativeHost = mockk<ReactNativeHost>(relaxed = true)
|
|
255
|
-
|
|
256
255
|
override val reactHost: ReactHost by lazy {
|
|
257
256
|
mockk<ReactHost>(relaxed = true)
|
|
258
257
|
.also {
|
package/build/Expo.d.ts
CHANGED
|
@@ -2,7 +2,7 @@ import './Expo.fx';
|
|
|
2
2
|
export { disableErrorHandling } from './errors/ExpoErrorManager';
|
|
3
3
|
export { default as registerRootComponent } from './launch/registerRootComponent';
|
|
4
4
|
export { isRunningInExpoGo, getExpoGoProjectConfig } from './environment/ExpoGo';
|
|
5
|
-
export { EventEmitter, SharedObject, SharedRef, NativeModule, requireNativeModule, requireOptionalNativeModule, requireNativeViewManager as requireNativeView, registerWebModule, reloadAppAsync, } from 'expo-modules-core';
|
|
5
|
+
export { EventEmitter, SharedObject, SharedRef, NativeModule, requireNativeModule, requireOptionalNativeModule, requireNativeViewManager as requireNativeView, registerWebModule, reloadAppAsync, installOnUIRuntime, } from 'expo-modules-core';
|
|
6
6
|
export type {
|
|
7
7
|
/** @deprecated Move to `SharedRef` with a type-only import instead */
|
|
8
8
|
SharedRef as SharedRefType,
|
package/build/Expo.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Expo.d.ts","sourceRoot":"","sources":["../src/Expo.ts"],"names":[],"mappings":"AAAA,OAAO,WAAW,CAAC;AAEnB,OAAO,EAAE,oBAAoB,EAAE,MAAM,2BAA2B,CAAC;AACjE,OAAO,EAAE,OAAO,IAAI,qBAAqB,EAAE,MAAM,gCAAgC,CAAC;AAElF,OAAO,EAAE,iBAAiB,EAAE,sBAAsB,EAAE,MAAM,sBAAsB,CAAC;AAEjF,OAAO,EAEL,YAAY,EACZ,YAAY,EACZ,SAAS,EACT,YAAY,EAGZ,mBAAmB,EACnB,2BAA2B,EAC3B,wBAAwB,IAAI,iBAAiB,EAC7C,iBAAiB,EACjB,cAAc,
|
|
1
|
+
{"version":3,"file":"Expo.d.ts","sourceRoot":"","sources":["../src/Expo.ts"],"names":[],"mappings":"AAAA,OAAO,WAAW,CAAC;AAEnB,OAAO,EAAE,oBAAoB,EAAE,MAAM,2BAA2B,CAAC;AACjE,OAAO,EAAE,OAAO,IAAI,qBAAqB,EAAE,MAAM,gCAAgC,CAAC;AAElF,OAAO,EAAE,iBAAiB,EAAE,sBAAsB,EAAE,MAAM,sBAAsB,CAAC;AAEjF,OAAO,EAEL,YAAY,EACZ,YAAY,EACZ,SAAS,EACT,YAAY,EAGZ,mBAAmB,EACnB,2BAA2B,EAC3B,wBAAwB,IAAI,iBAAiB,EAC7C,iBAAiB,EACjB,cAAc,EAGd,kBAAkB,GACnB,MAAM,mBAAmB,CAAC;AAE3B,YAAY;AACV,sEAAsE;AACtE,SAAS,IAAI,aAAa;AAC1B,yEAAyE;AACzE,YAAY,IAAI,gBAAgB;AAChC,yEAAyE;AACzE,YAAY,IAAI,gBAAgB;AAChC,yEAAyE;AACzE,YAAY,IAAI,gBAAgB,GACjC,MAAM,yBAAyB,CAAC;AAEjC,OAAO,EAAE,QAAQ,EAAE,gBAAgB,EAAE,MAAM,kBAAkB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"buildErrors.d.ts","sourceRoot":"","sources":["../../src/async-require/buildErrors.ts"],"names":[],"mappings":"AAEA,qBAAa,kBAAmB,SAAQ,KAAK;IACpC,eAAe,EAAE,MAAM,CAAC;gBAEnB,OAAO,GAAE,MAA8B,EAAE,IAAI,CAAC,EAAE,MAAM,EAAE,KAAK,CAAC,EAAE,KAAK;CAQlF"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getDevServer.d.ts","sourceRoot":"","sources":["../../src/async-require/getDevServer.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"getDevServer.d.ts","sourceRoot":"","sources":["../../src/async-require/getDevServer.ts"],"names":[],"mappings":"AAEA,QAAA,MAAM,YAAY;;IAcd,0DAA0D;;;CAM7D,CAAC;AAEF,eAAe,YAAY,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"getFullBundlerUrl.d.ts","sourceRoot":"","sources":["../../src/async-require/getFullBundlerUrl.ts"],"names":[],"mappings":"AAAA,wBAAgB,iBAAiB,IAAI,MAAM,CAY1C"}
|
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
type LogLevel = 'trace' | 'info' | 'warn' | 'error' | 'log' | 'group' | 'groupCollapsed' | 'groupEnd' | 'debug';
|
|
2
|
-
|
|
2
|
+
/**
|
|
3
|
+
* HMR Client that receives from the server HMR updates and propagates them
|
|
4
|
+
* runtime to reflects those changes.
|
|
5
|
+
*/
|
|
6
|
+
declare const HMRClient: {
|
|
3
7
|
enable(): void;
|
|
4
8
|
disable(): void;
|
|
5
9
|
registerBundle(requestUrl: string): void;
|
|
6
10
|
log(level: LogLevel, data: any[]): void;
|
|
7
|
-
setup(
|
|
11
|
+
setup(platformOrOptions: string | {
|
|
8
12
|
isEnabled: boolean;
|
|
9
|
-
}): void;
|
|
13
|
+
}, bundleEntry?: string, host?: string, port?: number | string, isEnabledOrUndefined?: boolean, scheme?: string): void;
|
|
14
|
+
_onMetroError(error: unknown): void;
|
|
10
15
|
};
|
|
11
|
-
/**
|
|
12
|
-
* HMR Client that receives from the server HMR updates and propagates them
|
|
13
|
-
* runtime to reflects those changes.
|
|
14
|
-
*/
|
|
15
|
-
declare const HMRClient: HMRClientNativeInterface;
|
|
16
16
|
export default HMRClient;
|
|
17
17
|
//# sourceMappingURL=hmr.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"hmr.d.ts","sourceRoot":"","sources":["../../src/async-require/hmr.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"hmr.d.ts","sourceRoot":"","sources":["../../src/async-require/hmr.ts"],"names":[],"mappings":"AAiCA,KAAK,QAAQ,GACT,OAAO,GACP,MAAM,GACN,MAAM,GACN,OAAO,GACP,KAAK,GACL,OAAO,GACP,gBAAgB,GAChB,UAAU,GACV,OAAO,CAAC;AAMZ;;;GAGG;AACH,QAAA,MAAM,SAAS;;;+BAyCc,MAAM;eAMtB,QAAQ,QAAQ,GAAG,EAAE;6BA8CX,MAAM,GAAG;QAAE,SAAS,EAAE,OAAO,CAAA;KAAE,gBACpC,MAAM,SACb,MAAM,SACN,MAAM,GAAG,MAAM,yBACC,OAAO,WACtB,MAAM;yBAmHK,OAAO;CA4B7B,CAAC;AA8DF,eAAe,SAAS,CAAC"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
export declare function getFullBundlerUrl(_: {
|
|
2
|
+
serverScheme?: string;
|
|
3
|
+
serverHost?: string;
|
|
4
|
+
bundleEntry?: string;
|
|
5
|
+
platform?: string;
|
|
6
|
+
}): string;
|
|
7
|
+
export declare function showLoading(message: string, _type: 'load' | 'refresh'): void;
|
|
8
|
+
export declare function hideLoading(): void;
|
|
9
|
+
export declare function resetErrorOverlay(): void;
|
|
10
|
+
export declare function reload(): void;
|
|
11
|
+
export declare function getConnectionError(serverHost: string, e: Error): string;
|
|
12
|
+
export declare function handleCompileError(cause: any): void;
|
|
13
|
+
//# sourceMappingURL=hmrUtils.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"hmrUtils.d.ts","sourceRoot":"","sources":["../../src/async-require/hmrUtils.ts"],"names":[],"mappings":"AAKA,wBAAgB,iBAAiB,CAAC,CAAC,EAAE;IACnC,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB,GAAG,MAAM,CAET;AAED,wBAAgB,WAAW,CAAC,OAAO,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,SAAS,QAKrE;AAED,wBAAgB,WAAW,SAE1B;AAED,wBAAgB,iBAAiB,SAGhC;AAED,wBAAgB,MAAM,SAGrB;AAED,wBAAgB,kBAAkB,CAAC,UAAU,EAAE,MAAM,EAAE,CAAC,EAAE,KAAK,GAAG,MAAM,CAWvE;AAED,wBAAgB,kBAAkB,CAAC,KAAK,EAAE,GAAG,QAK5C"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
export declare function showLoading(message: string, type: 'load' | 'refresh'): void;
|
|
2
|
+
export declare function hideLoading(): void;
|
|
3
|
+
export declare function resetErrorOverlay(): void;
|
|
4
|
+
export declare function reload(): void;
|
|
5
|
+
export declare function getFullBundlerUrl({ serverScheme, serverHost, bundleEntry, platform, }: {
|
|
6
|
+
serverScheme: string;
|
|
7
|
+
serverHost: string;
|
|
8
|
+
bundleEntry: string;
|
|
9
|
+
platform: string;
|
|
10
|
+
}): string;
|
|
11
|
+
export declare function getConnectionError(serverHost: string, e: Error): string;
|
|
12
|
+
export declare function handleCompileError(cause: any): void;
|
|
13
|
+
//# sourceMappingURL=hmrUtils.native.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"hmrUtils.native.d.ts","sourceRoot":"","sources":["../../src/async-require/hmrUtils.native.ts"],"names":[],"mappings":"AAWA,wBAAgB,WAAW,CAAC,OAAO,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,GAAG,SAAS,QAGpE;AAED,wBAAgB,WAAW,SAG1B;AAED,wBAAgB,iBAAiB,SAIhC;AAED,wBAAgB,MAAM,SAGrB;AAED,wBAAgB,iBAAiB,CAAC,EAChC,YAAY,EACZ,UAAU,EACV,WAAW,EACX,QAAQ,GACT,EAAE;IACD,YAAY,EAAE,MAAM,CAAC;IACrB,UAAU,EAAE,MAAM,CAAC;IACnB,WAAW,EAAE,MAAM,CAAC;IACpB,QAAQ,EAAE,MAAM,CAAC;CAClB,GAAG,MAAM,CAKT;AAED,wBAAgB,kBAAkB,CAAC,UAAU,EAAE,MAAM,EAAE,CAAC,EAAE,KAAK,GAAG,MAAM,CAkBvE;AAcD,wBAAgB,kBAAkB,CAAC,KAAK,EAAE,GAAG,QAe5C"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dom-entry.d.ts","sourceRoot":"","sources":["../../src/dom/dom-entry.tsx"],"names":[],"mappings":"AACA,OAAO,qBAAqB,CAAC;AAiE7B,wBAAgB,oBAAoB,CAAC,SAAS,EAAE,GAAG,
|
|
1
|
+
{"version":3,"file":"dom-entry.d.ts","sourceRoot":"","sources":["../../src/dom/dom-entry.tsx"],"names":[],"mappings":"AACA,OAAO,qBAAqB,CAAC;AAiE7B,wBAAgB,oBAAoB,CAAC,SAAS,EAAE,GAAG,QAoElD"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { DOMProps } from './dom.types';
|
|
2
|
+
export interface DOMPropsInternal extends DOMProps {
|
|
3
|
+
/**
|
|
4
|
+
* Allows dynamically redirecting a component to a different source, for example prebuilt version.
|
|
5
|
+
* @internal
|
|
6
|
+
*/
|
|
7
|
+
sourceOverride?: {
|
|
8
|
+
uri: string;
|
|
9
|
+
};
|
|
10
|
+
}
|
|
11
|
+
//# sourceMappingURL=dom-internal.types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"dom-internal.types.d.ts","sourceRoot":"","sources":["../../src/dom/dom-internal.types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AAE5C,MAAM,WAAW,gBAAiB,SAAQ,QAAQ;IAChD;;;OAGG;IACH,cAAc,CAAC,EAAE;QAAE,GAAG,EAAE,MAAM,CAAA;KAAE,CAAC;CAClC"}
|
package/build/dom/dom.types.d.ts
CHANGED
|
@@ -29,6 +29,11 @@ export interface DOMProps extends Omit<RNWebViewProps, 'source'> {
|
|
|
29
29
|
* @default false
|
|
30
30
|
*/
|
|
31
31
|
useExpoDOMWebView?: boolean;
|
|
32
|
+
/**
|
|
33
|
+
* Allows dynamically redirecting a component to a different source, for example a prebuilt version.
|
|
34
|
+
* @internal
|
|
35
|
+
*/
|
|
36
|
+
overrideUri?: string;
|
|
32
37
|
}
|
|
33
38
|
export {};
|
|
34
39
|
//# sourceMappingURL=dom.types.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dom.types.d.ts","sourceRoot":"","sources":["../../src/dom/dom.types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AAErE,MAAM,MAAM,SAAS,GAAG,OAAO,GAAG,MAAM,GAAG,MAAM,GAAG,IAAI,GAAG,SAAS,GAAG,UAAU,CAAC;AAElF,MAAM,WAAW,SAAU,SAAQ,KAAK,CAAC,SAAS,CAAC;CAAG;AAEtD,MAAM,WAAW,UAAU;IACzB,CAAC,GAAG,EAAE,MAAM,GAAG,SAAS,GAAG,SAAS,CAAC;CACtC;AAED,MAAM,MAAM,aAAa,CAAC,KAAK,SAAS,SAAS,IAAI;IACnD,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,KAAK,CAAC;CACb,CAAC;AAEF;;GAEG;AACH,MAAM,WAAW,oBAAoB;IACnC,CAAC,GAAG,EAAE,MAAM,GAAG,CAAC,GAAG,IAAI,EAAE,SAAS,EAAE,KAAK,IAAI,CAAC;CAC/C;AAED,KAAK,YAAY,GAAG,SAAS,CAAC;AAC9B,MAAM,MAAM,UAAU,GAAG,YAAY,CAAC;AACtC,MAAM,MAAM,YAAY,GAAG,cAAc,CAAC;AAE1C,MAAM,WAAW,QAAS,SAAQ,IAAI,CAAC,cAAc,EAAE,QAAQ,CAAC;IAC9D;;;OAGG;IACH,aAAa,CAAC,EAAE,OAAO,CAAC;IAExB;;;OAGG;IACH,iBAAiB,CAAC,EAAE,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"dom.types.d.ts","sourceRoot":"","sources":["../../src/dom/dom.types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AAErE,MAAM,MAAM,SAAS,GAAG,OAAO,GAAG,MAAM,GAAG,MAAM,GAAG,IAAI,GAAG,SAAS,GAAG,UAAU,CAAC;AAElF,MAAM,WAAW,SAAU,SAAQ,KAAK,CAAC,SAAS,CAAC;CAAG;AAEtD,MAAM,WAAW,UAAU;IACzB,CAAC,GAAG,EAAE,MAAM,GAAG,SAAS,GAAG,SAAS,CAAC;CACtC;AAED,MAAM,MAAM,aAAa,CAAC,KAAK,SAAS,SAAS,IAAI;IACnD,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,KAAK,CAAC;CACb,CAAC;AAEF;;GAEG;AACH,MAAM,WAAW,oBAAoB;IACnC,CAAC,GAAG,EAAE,MAAM,GAAG,CAAC,GAAG,IAAI,EAAE,SAAS,EAAE,KAAK,IAAI,CAAC;CAC/C;AAED,KAAK,YAAY,GAAG,SAAS,CAAC;AAC9B,MAAM,MAAM,UAAU,GAAG,YAAY,CAAC;AACtC,MAAM,MAAM,YAAY,GAAG,cAAc,CAAC;AAE1C,MAAM,WAAW,QAAS,SAAQ,IAAI,CAAC,cAAc,EAAE,QAAQ,CAAC;IAC9D;;;OAGG;IACH,aAAa,CAAC,EAAE,OAAO,CAAC;IAExB;;;OAGG;IACH,iBAAiB,CAAC,EAAE,OAAO,CAAC;IAE5B;;;OAGG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB"}
|
package/build/dom/internal.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"internal.d.ts","sourceRoot":"","sources":["../../src/dom/internal.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,IAAI,OAAO,EAAE,MAAM,mBAAmB,CAAC;
|
|
1
|
+
{"version":3,"file":"internal.d.ts","sourceRoot":"","sources":["../../src/dom/internal.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,IAAI,OAAO,EAAE,MAAM,mBAAmB,CAAC;AAEvD,cAAc,sBAAsB,CAAC;AAGrC,eAAO,MAAM,oBAAoB,EAAE,SAAS,GAAG,cAAc,aAAa,EAAE,oBACjE,CAAC"}
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import
|
|
2
|
+
import { DOMPropsInternal } from './dom-internal.types';
|
|
3
3
|
import ExpoDomWebView from './webview/ExpoDOMWebView';
|
|
4
4
|
import RNWebView from './webview/RNWebView';
|
|
5
5
|
type RawWebViewProps = React.ComponentProps<Exclude<typeof ExpoDomWebView, undefined>> & React.ComponentProps<Exclude<typeof RNWebView, undefined>>;
|
|
6
6
|
interface Props {
|
|
7
7
|
children?: any;
|
|
8
|
-
dom?:
|
|
8
|
+
dom?: DOMPropsInternal;
|
|
9
9
|
filePath: string;
|
|
10
10
|
ref: React.Ref<object>;
|
|
11
11
|
[propName: string]: unknown;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"webview-wrapper.d.ts","sourceRoot":"","sources":["../../src/dom/webview-wrapper.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"webview-wrapper.d.ts","sourceRoot":"","sources":["../../src/dom/webview-wrapper.tsx"],"names":[],"mappings":"AAKA,OAAO,KAAK,MAAM,OAAO,CAAC;AAI1B,OAAO,EAAE,gBAAgB,EAAE,MAAM,sBAAsB,CAAC;AAWxD,OAAO,cAAc,MAAM,0BAA0B,CAAC;AACtD,OAAO,SAAS,MAAM,qBAAqB,CAAC;AAG5C,KAAK,eAAe,GAAG,KAAK,CAAC,cAAc,CAAC,OAAO,CAAC,OAAO,cAAc,EAAE,SAAS,CAAC,CAAC,GACpF,KAAK,CAAC,cAAc,CAAC,OAAO,CAAC,OAAO,SAAS,EAAE,SAAS,CAAC,CAAC,CAAC;AAE7D,UAAU,KAAK;IACb,QAAQ,CAAC,EAAE,GAAG,CAAC;IACf,GAAG,CAAC,EAAE,gBAAgB,CAAC;IACvB,QAAQ,EAAE,MAAM,CAAC;IACjB,GAAG,EAAE,KAAK,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC;IACvB,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC;CAC7B;AAED,QAAA,MAAM,UAAU,mFAmMd,CAAC;AAiBH,wBAAgB,cAAc,CAC5B,iBAAiB,EAAE,OAAO,GACzB,KAAK,CAAC,yBAAyB,CAAC,eAAe,CAAC,CASlD;AAED,eAAe,UAAU,CAAC"}
|
|
@@ -15,7 +15,7 @@ type InferEventParameter<TEventListener extends AnyEventListener, TInitialValue>
|
|
|
15
15
|
/**
|
|
16
16
|
* React hook that listens to events emitted by the given object. The returned value is an event parameter
|
|
17
17
|
* that gets updated whenever a new event is dispatched.
|
|
18
|
-
* @param eventEmitter An object that emits events. For example, a native module or shared object or an instance of [`EventEmitter`](#
|
|
18
|
+
* @param eventEmitter An object that emits events. For example, a native module or shared object or an instance of [`EventEmitter`](#eventemittertype).
|
|
19
19
|
* @param eventName Name of the event to listen to.
|
|
20
20
|
* @param initialValue An event parameter to use until the event is called for the first time.
|
|
21
21
|
* @returns A parameter of the event listener.
|
|
@@ -35,7 +35,7 @@ export declare function useEvent<TEventsMap extends Record<string, AnyEventListe
|
|
|
35
35
|
/**
|
|
36
36
|
* React hook that listens to events emitted by the given object and calls the listener function whenever a new event is dispatched.
|
|
37
37
|
* The event listener is automatically added during the first render and removed when the component unmounts.
|
|
38
|
-
* @param eventEmitter An object that emits events. For example, a native module or shared object or an instance of [`EventEmitter`](#
|
|
38
|
+
* @param eventEmitter An object that emits events. For example, a native module or shared object or an instance of [`EventEmitter`](#eventemittertype).
|
|
39
39
|
* @param eventName Name of the event to listen to.
|
|
40
40
|
* @param listener A function to call when the event is dispatched.
|
|
41
41
|
* @example
|