expo-modules-core 2.3.4 → 2.3.5
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/CHANGELOG.md +10 -0
- package/android/build.gradle +2 -2
- package/build/EventEmitter.d.ts +10 -1
- package/build/EventEmitter.d.ts.map +1 -1
- package/build/LegacyEventEmitter.d.ts.map +1 -1
- package/build/NativeModulesProxy.native.d.ts.map +1 -1
- package/build/NativeViewManagerAdapter.native.d.ts.map +1 -1
- package/build/sweet/setUpErrorManager.fx.web.d.ts +1 -0
- package/common/cpp/fabric/ExpoViewProps.h +1 -1
- package/common/cpp/fabric/ExpoViewShadowNode.cpp +28 -1
- package/common/cpp/fabric/ExpoViewShadowNode.h +20 -2
- package/ios/Core/Views/SwiftUI/SwiftUIViewDefinition.swift +3 -2
- package/ios/Core/Views/SwiftUI/SwiftUIViewProps.h +30 -0
- package/ios/Core/Views/SwiftUI/SwiftUIVirtualViewObjC.mm +2 -1
- package/package.json +3 -3
- package/src/EventEmitter.ts +11 -1
- package/src/LegacyEventEmitter.ts +13 -5
- package/src/NativeModulesProxy.native.ts +2 -1
- package/src/NativeViewManagerAdapter.native.tsx +18 -0
- package/src/Platform.ts +1 -1
- package/src/sweet/setUpErrorManager.fx.ts +4 -0
- package/src/ts-declarations/NativeComponentRegistry.d.ts +12 -0
package/CHANGELOG.md
CHANGED
|
@@ -10,6 +10,16 @@
|
|
|
10
10
|
|
|
11
11
|
### 💡 Others
|
|
12
12
|
|
|
13
|
+
## 2.3.5 — 2025-04-14
|
|
14
|
+
|
|
15
|
+
### 🐛 Bug fixes
|
|
16
|
+
|
|
17
|
+
- Fixed `UnwrappedChildren` not get the unwrapped content view for SwiftUI integration. ([#36112](https://github.com/expo/expo/pull/36112) by [@kudo](https://github.com/kudo))
|
|
18
|
+
|
|
19
|
+
### 💡 Others
|
|
20
|
+
|
|
21
|
+
- Removed the limitation to use `collapsable={false}` when hosting a UIView in SwiftUI views. ([#36153](https://github.com/expo/expo/pull/36153) by [@kudo](https://github.com/kudo))
|
|
22
|
+
|
|
13
23
|
## 2.3.4 — 2025-04-11
|
|
14
24
|
|
|
15
25
|
### 🐛 Bug fixes
|
package/android/build.gradle
CHANGED
|
@@ -23,7 +23,7 @@ if (KOTLIN_MAJOR_VERSION >= 2) {
|
|
|
23
23
|
}
|
|
24
24
|
|
|
25
25
|
group = 'host.exp.exponent'
|
|
26
|
-
version = '2.3.
|
|
26
|
+
version = '2.3.5'
|
|
27
27
|
|
|
28
28
|
// List of features that are required by linked modules
|
|
29
29
|
def coreFeatures = project.findProperty("coreFeatures") ?: []
|
|
@@ -76,7 +76,7 @@ android {
|
|
|
76
76
|
defaultConfig {
|
|
77
77
|
consumerProguardFiles 'proguard-rules.pro'
|
|
78
78
|
versionCode 1
|
|
79
|
-
versionName "2.3.
|
|
79
|
+
versionName "2.3.5"
|
|
80
80
|
buildConfigField "String", "EXPO_MODULES_CORE_VERSION", "\"${versionName}\""
|
|
81
81
|
buildConfigField "boolean", "IS_NEW_ARCHITECTURE_ENABLED", isNewArchitectureEnabled.toString()
|
|
82
82
|
|
package/build/EventEmitter.d.ts
CHANGED
|
@@ -1,5 +1,14 @@
|
|
|
1
1
|
import type { EventEmitter } from './ts-declarations/EventEmitter';
|
|
2
|
-
|
|
2
|
+
/**
|
|
3
|
+
* A subscription object that allows to conveniently remove an event listener from the emitter.
|
|
4
|
+
*/
|
|
5
|
+
export interface EventSubscription {
|
|
6
|
+
/**
|
|
7
|
+
* Removes an event listener for which the subscription has been created.
|
|
8
|
+
* After calling this function, the listener will no longer receive any events from the emitter.
|
|
9
|
+
*/
|
|
10
|
+
remove(): void;
|
|
11
|
+
}
|
|
3
12
|
declare const _default: typeof EventEmitter;
|
|
4
13
|
export default _default;
|
|
5
14
|
//# sourceMappingURL=EventEmitter.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"EventEmitter.d.ts","sourceRoot":"","sources":["../src/EventEmitter.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,gCAAgC,CAAC;AAInE,
|
|
1
|
+
{"version":3,"file":"EventEmitter.d.ts","sourceRoot":"","sources":["../src/EventEmitter.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,gCAAgC,CAAC;AAInE;;GAEG;AACH,MAAM,WAAW,iBAAiB;IAChC;;;OAGG;IACH,MAAM,IAAI,IAAI,CAAC;CAChB;wBAE8C,OAAO,YAAY;AAAlE,wBAAmE"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"LegacyEventEmitter.d.ts","sourceRoot":"","sources":["../src/LegacyEventEmitter.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,kBAAkB,EAAY,MAAM,cAAc,CAAC;AAE5D,OAAO,EAAE,iBAAiB,EAAE,MAAM,gBAAgB,CAAC;
|
|
1
|
+
{"version":3,"file":"LegacyEventEmitter.d.ts","sourceRoot":"","sources":["../src/LegacyEventEmitter.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,kBAAkB,EAAY,MAAM,cAAc,CAAC;AAE5D,OAAO,EAAE,iBAAiB,EAAE,MAAM,gBAAgB,CAAC;AAWnD,KAAK,YAAY,GAAG;IAClB,oBAAoB,CAAC,EAAE,MAAM,CAAC;IAC9B,cAAc,CAAC,EAAE,MAAM,IAAI,CAAC;IAC5B,aAAa,CAAC,EAAE,MAAM,IAAI,CAAC;IAI3B,WAAW,CAAC,EAAE,GAAG,CAAC;IAClB,eAAe,CAAC,EAAE,GAAG,CAAC;CACvB,CAAC;AAEF;;GAEG;AACH,qBAAa,kBAAkB;IAC7B,cAAc,SAAK;IAGnB,aAAa,EAAE,YAAY,CAAC;IAG5B,aAAa,EAAE,kBAAkB,CAAC;gBAEtB,YAAY,EAAE,YAAY;IAWtC,WAAW,CAAC,CAAC,EAAE,SAAS,EAAE,MAAM,EAAE,QAAQ,EAAE,CAAC,KAAK,EAAE,CAAC,KAAK,IAAI,GAAG,iBAAiB;IAgBlF,kBAAkB,CAAC,SAAS,EAAE,MAAM,GAAG,IAAI;IAmB3C,kBAAkB,CAAC,YAAY,EAAE,iBAAiB,GAAG,IAAI;IAwBzD,IAAI,CAAC,SAAS,EAAE,MAAM,EAAE,GAAG,MAAM,EAAE,GAAG,EAAE,GAAG,IAAI;CAGhD"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"NativeModulesProxy.native.d.ts","sourceRoot":"","sources":["../src/NativeModulesProxy.native.ts"],"names":[],"mappings":"AAOA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,4BAA4B,CAAC;AAUpE;;;GAGG;AACH,QAAA,MAAM,kBAAkB,EAAE,MAAM,CAAC,MAAM,EAAE,iBAAiB,CAAM,CAAC;
|
|
1
|
+
{"version":3,"file":"NativeModulesProxy.native.d.ts","sourceRoot":"","sources":["../src/NativeModulesProxy.native.ts"],"names":[],"mappings":"AAOA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,4BAA4B,CAAC;AAUpE;;;GAGG;AACH,QAAA,MAAM,kBAAkB,EAAE,MAAM,CAAC,MAAM,EAAE,iBAAiB,CAAM,CAAC;AAgEjE,eAAe,kBAAkB,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"NativeViewManagerAdapter.native.d.ts","sourceRoot":"","sources":["../src/NativeViewManagerAdapter.native.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"NativeViewManagerAdapter.native.d.ts","sourceRoot":"","sources":["../src/NativeViewManagerAdapter.native.tsx"],"names":[],"mappings":"AAMA,OAAO,EAAkB,KAAK,aAAa,EAA4B,MAAM,OAAO,CAAC;AA6FrF;;GAEG;AACH,wBAAgB,wBAAwB,CAAC,CAAC,EACxC,UAAU,EAAE,MAAM,EAClB,QAAQ,CAAC,EAAE,MAAM,GAChB,aAAa,CAAC,CAAC,CAAC,CAiDlB"}
|
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
|
|
11
11
|
namespace expo {
|
|
12
12
|
|
|
13
|
-
class ExpoViewProps
|
|
13
|
+
class ExpoViewProps : public facebook::react::ViewProps {
|
|
14
14
|
public:
|
|
15
15
|
ExpoViewProps() = default;
|
|
16
16
|
ExpoViewProps(const facebook::react::PropsParserContext &context,
|
|
@@ -2,8 +2,35 @@
|
|
|
2
2
|
|
|
3
3
|
#include "ExpoViewShadowNode.h"
|
|
4
4
|
|
|
5
|
+
namespace react = facebook::react;
|
|
6
|
+
|
|
5
7
|
namespace expo {
|
|
6
8
|
|
|
7
|
-
|
|
9
|
+
extern const char ExpoViewComponentName[] = "ExpoFabricView";
|
|
10
|
+
|
|
11
|
+
ExpoViewShadowNode::ExpoViewShadowNode(
|
|
12
|
+
const react::ShadowNodeFragment &fragment,
|
|
13
|
+
const react::ShadowNodeFamily::Shared &family,
|
|
14
|
+
react::ShadowNodeTraits traits)
|
|
15
|
+
: ConcreteViewShadowNode(fragment, family, traits) {
|
|
16
|
+
initialize();
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
ExpoViewShadowNode::ExpoViewShadowNode(
|
|
20
|
+
const react::ShadowNode &sourceShadowNode,
|
|
21
|
+
const react::ShadowNodeFragment &fragment)
|
|
22
|
+
: ConcreteViewShadowNode(sourceShadowNode, fragment) {
|
|
23
|
+
initialize();
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
void ExpoViewShadowNode::initialize() noexcept {
|
|
27
|
+
auto &viewProps = static_cast<const ExpoViewProps &>(*props_);
|
|
28
|
+
|
|
29
|
+
if (viewProps.collapsableChildren) {
|
|
30
|
+
traits_.set(react::ShadowNodeTraits::Trait::ChildrenFormStackingContext);
|
|
31
|
+
} else {
|
|
32
|
+
traits_.unset(react::ShadowNodeTraits::Trait::ChildrenFormStackingContext);
|
|
33
|
+
}
|
|
34
|
+
}
|
|
8
35
|
|
|
9
36
|
} // namespace expo
|
|
@@ -6,17 +6,35 @@
|
|
|
6
6
|
|
|
7
7
|
#include <react/renderer/components/view/ConcreteViewShadowNode.h>
|
|
8
8
|
|
|
9
|
-
#include "ExpoViewProps.h"
|
|
10
9
|
#include "ExpoViewEventEmitter.h"
|
|
10
|
+
#include "ExpoViewProps.h"
|
|
11
11
|
#include "ExpoViewState.h"
|
|
12
12
|
|
|
13
13
|
namespace expo {
|
|
14
14
|
|
|
15
15
|
extern const char ExpoViewComponentName[];
|
|
16
16
|
|
|
17
|
-
class ExpoViewShadowNode final : public facebook::react::ConcreteViewShadowNode<
|
|
17
|
+
class ExpoViewShadowNode final : public facebook::react::ConcreteViewShadowNode<
|
|
18
|
+
ExpoViewComponentName, ExpoViewProps,
|
|
19
|
+
ExpoViewEventEmitter, ExpoViewState> {
|
|
18
20
|
public:
|
|
19
21
|
using ConcreteViewShadowNode::ConcreteViewShadowNode;
|
|
22
|
+
|
|
23
|
+
ExpoViewShadowNode(const facebook::react::ShadowNodeFragment &fragment,
|
|
24
|
+
const facebook::react::ShadowNodeFamily::Shared &family,
|
|
25
|
+
facebook::react::ShadowNodeTraits traits);
|
|
26
|
+
|
|
27
|
+
ExpoViewShadowNode(const facebook::react::ShadowNode &sourceShadowNode,
|
|
28
|
+
const facebook::react::ShadowNodeFragment &fragment);
|
|
29
|
+
|
|
30
|
+
public:
|
|
31
|
+
static facebook::react::ShadowNodeTraits BaseTraits() {
|
|
32
|
+
auto traits = ConcreteViewShadowNode::BaseTraits();
|
|
33
|
+
return traits;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
private:
|
|
37
|
+
void initialize() noexcept;
|
|
20
38
|
};
|
|
21
39
|
|
|
22
40
|
} // namespace expo
|
|
@@ -45,8 +45,9 @@ public extension ExpoSwiftUIView {
|
|
|
45
45
|
}
|
|
46
46
|
return AnyView(
|
|
47
47
|
Group {
|
|
48
|
-
if let hostingView = child as? ExpoSwiftUI.UIViewHost
|
|
49
|
-
let
|
|
48
|
+
if let hostingView = child as? ExpoSwiftUI.UIViewHost,
|
|
49
|
+
let hostingUIView = hostingView.view as? (any ExpoSwiftUI.AnyHostingView) {
|
|
50
|
+
let content = hostingUIView.getContentView()
|
|
50
51
|
transform(
|
|
51
52
|
AnyView(
|
|
52
53
|
content
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
// Copyright 2015-present 650 Industries. All rights reserved.
|
|
2
|
+
|
|
3
|
+
#pragma once
|
|
4
|
+
|
|
5
|
+
#ifdef __cplusplus
|
|
6
|
+
|
|
7
|
+
#include <ExpoModulesCore/ExpoViewProps.h>
|
|
8
|
+
|
|
9
|
+
namespace expo {
|
|
10
|
+
|
|
11
|
+
/**
|
|
12
|
+
An `ExpoViewProps` derived class specific for SwiftUI that disables `collapsableChildren` by default
|
|
13
|
+
*/
|
|
14
|
+
class SwiftUIViewProps final : public ExpoViewProps {
|
|
15
|
+
public:
|
|
16
|
+
SwiftUIViewProps() : ExpoViewProps() {
|
|
17
|
+
this->collapsableChildren = false;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
SwiftUIViewProps(const facebook::react::PropsParserContext &context,
|
|
21
|
+
const ExpoViewProps &sourceProps,
|
|
22
|
+
const facebook::react::RawProps &rawProps)
|
|
23
|
+
: ExpoViewProps(context, sourceProps, rawProps) {
|
|
24
|
+
this->collapsableChildren = false;
|
|
25
|
+
}
|
|
26
|
+
};
|
|
27
|
+
|
|
28
|
+
} // namespace expo
|
|
29
|
+
|
|
30
|
+
#endif // __cplusplus
|
|
@@ -11,6 +11,7 @@
|
|
|
11
11
|
|
|
12
12
|
#import <ExpoModulesCore/ExpoViewComponentDescriptor.h>
|
|
13
13
|
#import <ExpoModulesCore/EXJSIConversions.h>
|
|
14
|
+
#import <ExpoModulesCore/SwiftUIViewProps.h>
|
|
14
15
|
#import <React/RCTAssert.h>
|
|
15
16
|
#import <React/RCTComponentViewProtocol.h>
|
|
16
17
|
|
|
@@ -89,7 +90,7 @@ static std::unordered_map<std::string, expo::ExpoViewComponentDescriptor::Flavor
|
|
|
89
90
|
- (instancetype)init
|
|
90
91
|
{
|
|
91
92
|
if (self = [super init]) {
|
|
92
|
-
static const auto defaultProps = std::make_shared<const expo::
|
|
93
|
+
static const auto defaultProps = std::make_shared<const expo::SwiftUIViewProps>();
|
|
93
94
|
_props = defaultProps;
|
|
94
95
|
}
|
|
95
96
|
return self;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "expo-modules-core",
|
|
3
|
-
"version": "2.3.
|
|
3
|
+
"version": "2.3.5",
|
|
4
4
|
"description": "The core of Expo Modules architecture",
|
|
5
5
|
"main": "src/index.ts",
|
|
6
6
|
"types": "build/index.d.ts",
|
|
@@ -42,7 +42,7 @@
|
|
|
42
42
|
},
|
|
43
43
|
"devDependencies": {
|
|
44
44
|
"@testing-library/react-native": "^13.1.0",
|
|
45
|
-
"expo-module-scripts": "^4.1.
|
|
45
|
+
"expo-module-scripts": "^4.1.2"
|
|
46
46
|
},
|
|
47
|
-
"gitHead": "
|
|
47
|
+
"gitHead": "335e9312f5caf634097354a230f0d4bbbfb9b0ba"
|
|
48
48
|
}
|
package/src/EventEmitter.ts
CHANGED
|
@@ -5,5 +5,15 @@ import type { EventEmitter } from './ts-declarations/EventEmitter';
|
|
|
5
5
|
|
|
6
6
|
ensureNativeModulesAreInstalled();
|
|
7
7
|
|
|
8
|
-
|
|
8
|
+
/**
|
|
9
|
+
* A subscription object that allows to conveniently remove an event listener from the emitter.
|
|
10
|
+
*/
|
|
11
|
+
export interface EventSubscription {
|
|
12
|
+
/**
|
|
13
|
+
* Removes an event listener for which the subscription has been created.
|
|
14
|
+
* After calling this function, the listener will no longer receive any events from the emitter.
|
|
15
|
+
*/
|
|
16
|
+
remove(): void;
|
|
17
|
+
}
|
|
18
|
+
|
|
9
19
|
export default globalThis.expo.EventEmitter as typeof EventEmitter;
|
|
@@ -3,7 +3,14 @@ import { NativeEventEmitter, Platform } from 'react-native';
|
|
|
3
3
|
|
|
4
4
|
import { EventSubscription } from './EventEmitter';
|
|
5
5
|
|
|
6
|
-
const nativeEmitterSubscriptionKey = '@@nativeEmitterSubscription@@';
|
|
6
|
+
const nativeEmitterSubscriptionKey = '@@nativeEmitterSubscription@@' as const;
|
|
7
|
+
|
|
8
|
+
type SubscriptionState = {
|
|
9
|
+
// NOTE(@kitten): Since this is legacy/deprecated, we don't need to be exact about types here
|
|
10
|
+
[Key in typeof nativeEmitterSubscriptionKey]?: {
|
|
11
|
+
remove?(): void;
|
|
12
|
+
};
|
|
13
|
+
} & EventSubscription;
|
|
7
14
|
|
|
8
15
|
type NativeModule = {
|
|
9
16
|
__expo_module_name__?: string;
|
|
@@ -46,7 +53,7 @@ export class LegacyEventEmitter {
|
|
|
46
53
|
|
|
47
54
|
this._listenerCount++;
|
|
48
55
|
const nativeEmitterSubscription = this._eventEmitter.addListener(eventName, listener);
|
|
49
|
-
const subscription = {
|
|
56
|
+
const subscription: SubscriptionState = {
|
|
50
57
|
[nativeEmitterSubscriptionKey]: nativeEmitterSubscription,
|
|
51
58
|
remove: () => {
|
|
52
59
|
this.removeSubscription(subscription);
|
|
@@ -75,19 +82,20 @@ export class LegacyEventEmitter {
|
|
|
75
82
|
}
|
|
76
83
|
|
|
77
84
|
removeSubscription(subscription: EventSubscription): void {
|
|
78
|
-
const
|
|
85
|
+
const state = subscription as SubscriptionState;
|
|
86
|
+
const nativeEmitterSubscription = state[nativeEmitterSubscriptionKey];
|
|
79
87
|
if (!nativeEmitterSubscription) {
|
|
80
88
|
return;
|
|
81
89
|
}
|
|
82
90
|
|
|
83
91
|
if ('remove' in nativeEmitterSubscription) {
|
|
84
|
-
nativeEmitterSubscription.remove();
|
|
92
|
+
nativeEmitterSubscription.remove?.();
|
|
85
93
|
}
|
|
86
94
|
this._listenerCount--;
|
|
87
95
|
|
|
88
96
|
// Ensure that the emitter's internal state remains correct even if `removeSubscription` is
|
|
89
97
|
// called again with the same subscription
|
|
90
|
-
delete
|
|
98
|
+
delete state[nativeEmitterSubscriptionKey];
|
|
91
99
|
|
|
92
100
|
// Release closed-over references to the emitter
|
|
93
101
|
subscription.remove = () => {};
|
|
@@ -30,7 +30,8 @@ if (LegacyNativeProxy) {
|
|
|
30
30
|
NativeModulesProxy[moduleName] = NativeProxy[modulesConstantsKey][moduleName] || {};
|
|
31
31
|
|
|
32
32
|
// copy methods
|
|
33
|
-
|
|
33
|
+
// TODO(@kitten): Annotate `NativeProxy` with abstract types to avoid implicit `any`
|
|
34
|
+
NativeProxy[exportedMethodsKey][moduleName].forEach((methodInfo: any) => {
|
|
34
35
|
NativeModulesProxy[moduleName][methodInfo.name] = (...args: unknown[]): Promise<any> => {
|
|
35
36
|
// Use the new proxy to call methods on legacy modules, if possible.
|
|
36
37
|
if (ExpoNativeProxy?.callMethod) {
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
// Copyright © 2024 650 Industries.
|
|
2
2
|
|
|
3
|
+
/// <reference path="ts-declarations/NativeComponentRegistry.d.ts" />
|
|
4
|
+
|
|
3
5
|
'use client';
|
|
4
6
|
|
|
5
7
|
import { type Component, type ComponentType, createRef, PureComponent } from 'react';
|
|
@@ -27,6 +29,22 @@ import { requireNativeModule } from './requireNativeModule';
|
|
|
27
29
|
*/
|
|
28
30
|
const nativeComponentsCache = new Map<string, HostComponent<any>>();
|
|
29
31
|
|
|
32
|
+
// TODO(@kitten): Optimally, this is defined on ExpoGlobal, but we treat `__expo_app_identifier__` as internal
|
|
33
|
+
declare namespace globalThis {
|
|
34
|
+
const expo:
|
|
35
|
+
| undefined
|
|
36
|
+
| {
|
|
37
|
+
__expo_app_identifier__?: string;
|
|
38
|
+
getViewConfig(
|
|
39
|
+
moduleName: string,
|
|
40
|
+
viewName?: string
|
|
41
|
+
): {
|
|
42
|
+
validAttributes: Record<string, any>;
|
|
43
|
+
directEventTypes: Record<string, { registrationName: string }>;
|
|
44
|
+
} | null;
|
|
45
|
+
};
|
|
46
|
+
}
|
|
47
|
+
|
|
30
48
|
/**
|
|
31
49
|
* Requires a React Native component using the static view config from an Expo module.
|
|
32
50
|
*/
|
package/src/Platform.ts
CHANGED
|
@@ -25,7 +25,7 @@ const nativeSelect =
|
|
|
25
25
|
function select<T>(specifics: { [platform in PlatformSelectOSType]?: T }): T | undefined {
|
|
26
26
|
if (!process.env.EXPO_OS) return undefined;
|
|
27
27
|
if (specifics.hasOwnProperty(process.env.EXPO_OS)) {
|
|
28
|
-
return specifics[process.env.EXPO_OS]!;
|
|
28
|
+
return specifics[process.env.EXPO_OS as PlatformSelectOSType]!;
|
|
29
29
|
} else if (process.env.EXPO_OS !== 'web' && specifics.hasOwnProperty('native')) {
|
|
30
30
|
return specifics.native!;
|
|
31
31
|
} else if (specifics.hasOwnProperty('default')) {
|
|
@@ -15,5 +15,9 @@ if (__DEV__ && Platform.OS === 'android' && NativeErrorManager) {
|
|
|
15
15
|
});
|
|
16
16
|
}
|
|
17
17
|
|
|
18
|
+
declare namespace globalThis {
|
|
19
|
+
let ExpoModulesCore_CodedError: undefined | typeof CodedError;
|
|
20
|
+
}
|
|
21
|
+
|
|
18
22
|
// We have to export `CodedError` via global object to use in later in the C++ code.
|
|
19
23
|
globalThis.ExpoModulesCore_CodedError = CodedError;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
declare module 'react-native/Libraries/NativeComponent/NativeComponentRegistry' {
|
|
2
|
+
import type { HostComponent } from 'react-native';
|
|
3
|
+
|
|
4
|
+
export function get<Props>(
|
|
5
|
+
name: string,
|
|
6
|
+
register: () => {
|
|
7
|
+
uiViewClassName: string;
|
|
8
|
+
validAttributes?: Record<string, any>;
|
|
9
|
+
directEventTypes?: Record<string, { registrationName: string }>;
|
|
10
|
+
}
|
|
11
|
+
): HostComponent<Props>;
|
|
12
|
+
}
|