@office-iss/react-native-win32 0.83.0-preview.1 → 0.84.0-preview.1
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/.flowconfig +2 -2
- package/CHANGELOG.json +42 -6
- package/CHANGELOG.md +22 -5
- package/IntegrationTests/AccessibilityManagerTest.js +10 -7
- package/IntegrationTests/ImageCachePolicyTest.js +8 -8
- package/IntegrationTests/IntegrationTestsApp.js +3 -3
- package/IntegrationTests/LayoutEventsTest.js +1 -1
- package/IntegrationTests/TimersTest.js +1 -1
- package/IntegrationTests/WebSocketTest.js +1 -1
- package/Libraries/Animated/AnimatedEvent.js +2 -2
- package/Libraries/Animated/animations/Animation.js +1 -3
- package/Libraries/Animated/createAnimatedComponent.js +8 -5
- package/Libraries/Animated/nodes/AnimatedColor.js +1 -1
- package/Libraries/Animated/nodes/AnimatedInterpolation.js +40 -4
- package/Libraries/Animated/nodes/AnimatedNode.js +3 -3
- package/Libraries/Animated/nodes/AnimatedObject.js +16 -11
- package/Libraries/Animated/nodes/AnimatedProps.js +43 -12
- package/Libraries/Animated/nodes/AnimatedStyle.js +12 -12
- package/Libraries/Animated/nodes/AnimatedValue.js +6 -3
- package/Libraries/Animated/nodes/AnimatedValueXY.js +1 -1
- package/Libraries/BatchedBridge/MessageQueue.js +24 -22
- package/Libraries/Blob/URL.js +34 -3
- package/Libraries/Blob/URLSearchParams.js +1 -0
- package/Libraries/Components/AccessibilityInfo/AccessibilityInfo.d.ts +6 -0
- package/Libraries/Components/AccessibilityInfo/AccessibilityInfo.js +6 -1
- package/Libraries/Components/AccessibilityInfo/AccessibilityInfo.win32.js +8 -1
- package/Libraries/Components/Button.js +2 -5
- package/Libraries/Components/Button.win32.js +2 -5
- package/Libraries/Components/DrawerAndroid/DrawerLayoutAndroid.android.js +1 -1
- package/Libraries/Components/DrawerAndroid/DrawerLayoutAndroidTypes.js +4 -4
- package/Libraries/Components/Keyboard/Keyboard.js +2 -2
- package/Libraries/Components/Pressable/Pressable.js +8 -8
- package/Libraries/Components/Pressable/Pressable.win32.js +14 -13
- package/Libraries/Components/TextInput/TextInput.flow.js +13 -13
- package/Libraries/Components/TextInput/TextInput.flow.win32.js +13 -13
- package/Libraries/Components/TextInput/TextInput.js +33 -34
- package/Libraries/Components/TextInput/TextInput.win32.js +39 -39
- package/Libraries/Components/Touchable/PooledClass.js +2 -2
- package/Libraries/Components/Touchable/TouchableBounce.js +3 -3
- package/Libraries/Components/Touchable/TouchableNativeFeedback.js +1 -1
- package/Libraries/Components/Touchable/TouchableNativeFeedback.win32.js +1 -1
- package/Libraries/Components/Touchable/TouchableWithoutFeedback.js +9 -9
- package/Libraries/Components/View/View.win32.js +5 -5
- package/Libraries/Components/View/ViewPropTypes.js +16 -6
- package/Libraries/Components/View/ViewPropTypes.win32.js +20 -10
- package/Libraries/Core/Devtools/loadBundleFromServer.js +6 -3
- package/Libraries/Core/Devtools/loadBundleFromServer.win32.js +6 -3
- package/Libraries/Core/Devtools/symbolicateStackTrace.js +1 -1
- package/Libraries/Core/ExceptionsManager.js +3 -3
- package/Libraries/Core/RawEventEmitter.js +1 -1
- package/Libraries/Core/ReactFiberErrorDialog.js +1 -1
- package/Libraries/Core/ReactNativeVersion.js +1 -1
- package/Libraries/Core/setUpDeveloperTools.js +1 -1
- package/Libraries/Core/setUpErrorHandling.js +1 -1
- package/Libraries/EventEmitter/NativeEventEmitter.js +2 -2
- package/Libraries/Image/Image.android.js +2 -2
- package/Libraries/Image/Image.ios.js +2 -2
- package/Libraries/Image/Image.win32.js +1 -1
- package/Libraries/Image/ImageProps.js +1 -1
- package/Libraries/Image/ImageTypes.flow.js +2 -2
- package/Libraries/Interaction/InteractionManager.js +3 -3
- package/Libraries/Interaction/PanResponder.js +1 -1
- package/Libraries/LayoutAnimation/LayoutAnimation.js +1 -1
- package/Libraries/Linking/Linking.js +1 -1
- package/Libraries/Lists/FlatList.js +2 -2
- package/Libraries/LogBox/Data/LogBoxData.js +31 -4
- package/Libraries/LogBox/Data/LogBoxLog.js +2 -2
- package/Libraries/LogBox/Data/LogBoxSymbolication.js +1 -1
- package/Libraries/LogBox/Data/parseLogBoxLog.js +5 -5
- package/Libraries/LogBox/LogBox.js +7 -7
- package/Libraries/NativeComponent/BaseViewConfig.android.js +12 -0
- package/Libraries/NativeComponent/StaticViewConfigValidator.js +4 -4
- package/Libraries/NativeComponent/ViewConfigIgnore.js +1 -1
- package/Libraries/Network/RCTNetworking.android.js +3 -3
- package/Libraries/Network/RCTNetworking.ios.js +2 -2
- package/Libraries/Network/RCTNetworking.js.flow +2 -2
- package/Libraries/Network/RCTNetworking.win32.js +2 -2
- package/Libraries/Pressability/Pressability.js +9 -9
- package/Libraries/Pressability/Pressability.win32.js +17 -16
- package/Libraries/ReactNative/AppRegistry.flow.js +1 -1
- package/Libraries/ReactNative/BridgelessUIManager.js +1 -1
- package/Libraries/ReactNative/FabricUIManager.js +1 -1
- package/Libraries/ReactNative/PaperUIManager.js +1 -1
- package/Libraries/ReactNative/PaperUIManager.win32.js +1 -1
- package/Libraries/ReactNative/ReactFabricPublicInstance/ReactFabricPublicInstance.js +1 -1
- package/Libraries/ReactNative/ReactFabricPublicInstance/ReactFabricPublicInstanceUtils.js +2 -2
- package/Libraries/ReactNative/ReactFabricPublicInstance/ReactNativeAttributePayload.js +1 -1
- package/Libraries/ReactNative/RendererImplementation.js +1 -1
- package/Libraries/ReactNative/getNativeComponentAttributes.js +1 -1
- package/Libraries/ReactPrivate/ReactNativePrivateInterface.js +1 -2
- package/Libraries/Renderer/implementations/ReactFabric-dev.js +3 -3
- package/Libraries/Renderer/implementations/ReactFabric-prod.js +3 -3
- package/Libraries/Renderer/implementations/ReactFabric-profiling.js +3 -3
- package/Libraries/Renderer/implementations/ReactNativeRenderer-dev.js +11 -4
- package/Libraries/Renderer/implementations/ReactNativeRenderer-prod.js +11 -4
- package/Libraries/Renderer/implementations/ReactNativeRenderer-profiling.js +11 -4
- package/Libraries/Renderer/shims/ReactFabric.js +3 -1
- package/Libraries/Renderer/shims/ReactFeatureFlags.js +3 -1
- package/Libraries/Renderer/shims/ReactNative.js +2 -2
- package/Libraries/Renderer/shims/ReactNativeTypes.js +3 -1
- package/Libraries/Renderer/shims/ReactNativeTypes.win32.js +3 -1
- package/Libraries/Renderer/shims/ReactNativeViewConfigRegistry.js +3 -1
- package/Libraries/Renderer/shims/createReactNativeComponentClass.js +3 -1
- package/Libraries/Settings/Settings.ios.js +1 -1
- package/Libraries/StyleSheet/PlatformColorValueTypes.android.js +2 -2
- package/Libraries/StyleSheet/PlatformColorValueTypes.ios.js +1 -1
- package/Libraries/StyleSheet/PlatformColorValueTypes.js.flow +4 -2
- package/Libraries/StyleSheet/StyleSheetExports.js +1 -1
- package/Libraries/StyleSheet/StyleSheetTypes.d.ts +99 -4
- package/Libraries/StyleSheet/StyleSheetTypes.js +6 -8
- package/Libraries/StyleSheet/processFilter.js +1 -1
- package/Libraries/Text/Text.js +46 -6
- package/Libraries/Text/Text.win32.js +46 -6
- package/Libraries/Text/TextNativeComponent.js +1 -1
- package/Libraries/Text/TextNativeComponent.win32.js +1 -1
- package/Libraries/Text/TextProps.js +7 -7
- package/Libraries/Text/TextProps.win32.js +7 -7
- package/Libraries/Types/CodegenTypes.js +1 -1
- package/Libraries/Types/CoreEventTypes.js +31 -0
- package/Libraries/Types/CoreEventTypes.win32.js +30 -13
- package/Libraries/Types/ReactDevToolsTypes.js +2 -2
- package/Libraries/Utilities/Appearance.js +2 -2
- package/Libraries/Utilities/DevLoadingView.js +8 -1
- package/Libraries/Utilities/DevSettings.js +3 -3
- package/Libraries/Utilities/HMRClient.js +4 -3
- package/Libraries/Utilities/RCTLog.js +3 -3
- package/Libraries/Utilities/ReactNativeTestTools.js +1 -1
- package/Libraries/Utilities/SceneTracker.js +1 -1
- package/Libraries/Utilities/codegenNativeCommands.js +1 -1
- package/Libraries/Utilities/deepFreezeAndThrowOnMutationInDev.js +3 -3
- package/Libraries/Utilities/logError.js +1 -1
- package/Libraries/Utilities/stringifySafe.js +7 -7
- package/Libraries/Utilities/useRefEffect.js +1 -1
- package/Libraries/WebSocket/WebSocketInterceptor.js +3 -3
- package/Libraries/promiseRejectionTrackingOptions.js +8 -8
- package/Libraries/vendor/core/ErrorUtils.js +10 -10
- package/Libraries/vendor/emitter/EventEmitter.js +6 -6
- package/flow/HermesInternalType.js +6 -6
- package/flow/bom.js.flow +35 -28
- package/flow/cssom.js.flow +3 -3
- package/flow/dom.js.flow +34 -33
- package/index.js +3 -0
- package/index.win32.js +3 -0
- package/index.win32.js.flow +8 -0
- package/jest/mock.js +2 -2
- package/jest/mockComponent.js +1 -1
- package/jest/setup.js +1 -1
- package/overrides.json +23 -23
- package/package.json +19 -18
- package/src/private/animated/NativeAnimatedHelper.js +130 -125
- package/src/private/animated/NativeAnimatedHelper.win32.js +130 -125
- package/src/private/animated/NativeAnimatedValidation.js +7 -4
- package/src/private/animated/createAnimatedPropsHook.js +13 -5
- package/src/private/animated/createAnimatedPropsMemoHook.js +10 -10
- package/src/private/components/virtualview/VirtualView.js +16 -9
- package/src/private/components/virtualview/logger/VirtualViewLogger.js +21 -0
- package/src/private/components/virtualview/logger/VirtualViewLoggerTypes.js +24 -0
- package/src/private/devsupport/devmenu/elementinspector/ElementProperties.js +1 -1
- package/src/private/devsupport/devmenu/elementinspector/Inspector.js +6 -25
- package/src/private/devsupport/devmenu/elementinspector/InspectorPanel.js +1 -27
- package/src/private/devsupport/devmenu/elementinspector/XHRInterceptor.js +3 -2
- package/src/private/featureflags/ReactNativeFeatureFlags.js +63 -42
- package/src/private/featureflags/ReactNativeFeatureFlagsBase.js +3 -3
- package/src/private/featureflags/specs/NativeReactNativeFeatureFlags.js +12 -9
- package/src/private/renderer/errorhandling/ErrorHandlers.js +7 -4
- package/src/private/specs_DEPRECATED/modules/NativeAccessibilityManager.js +1 -1
- package/src/private/specs_DEPRECATED/modules/NativeAnimatedModule.js +4 -0
- package/src/private/specs_DEPRECATED/modules/NativeDevLoadingView.js +1 -0
- package/src/private/webapis/dom/events/CustomEvent.js +3 -3
- package/src/private/webapis/dom/nodes/internals/ReactNativeDocumentElementInstanceHandle.js +1 -1
- package/src/private/webapis/dom/nodes/internals/ReactNativeDocumentInstanceHandle.js +1 -1
- package/src/private/webapis/dom/nodes/specs/NativeDOM.js +29 -29
- package/src/private/webapis/dom/oldstylecollections/HTMLCollection.js +1 -1
- package/src/private/webapis/dom/oldstylecollections/NodeList.js +2 -2
- package/src/private/webapis/geometry/DOMRectReadOnly.js +1 -1
- package/src/private/webapis/html/events/MessageEvent.js +3 -3
- package/src/private/webapis/idlecallbacks/specs/NativeIdleCallbacks.js +3 -3
- package/src/private/webapis/intersectionobserver/IntersectionObserver.js +53 -5
- package/src/private/webapis/intersectionobserver/internals/IntersectionObserverManager.js +2 -2
- package/src/private/webapis/intersectionobserver/specs/NativeIntersectionObserver.js +4 -4
- package/src/private/webapis/microtasks/specs/NativeMicrotasks.js +1 -1
- package/src/private/webapis/mutationobserver/MutationObserver.js +1 -1
- package/src/private/webapis/mutationobserver/MutationRecord.js +1 -1
- package/src/private/webapis/mutationobserver/specs/NativeMutationObserver.js +4 -4
- package/src/private/webapis/performance/Performance.js +1 -1
- package/src/private/webapis/performance/UserTiming.js +1 -1
- package/src/private/webapis/performance/specs/NativePerformance.js +3 -3
- package/src/private/webapis/structuredClone/structuredClone.js +3 -3
- package/src/types/globals.d.ts +30 -1
- package/src-win/Libraries/Components/AccessibilityInfo/AccessibilityInfo.d.ts +6 -0
- package/src-win/index.win32.js.flow +8 -0
- package/src/private/devsupport/devmenu/elementinspector/NetworkOverlay.js +0 -628
- package/src/private/devsupport/devmenu/perfmonitor/PerformanceOverlay.js +0 -66
package/.flowconfig
CHANGED
|
@@ -144,7 +144,7 @@ module.name_mapper='^@office-iss/react-native-win32$' -> '<PROJECT_ROOT>/index.w
|
|
|
144
144
|
module.name_mapper='^react-native/\(.*\)$' -> '<PROJECT_ROOT>/\1'
|
|
145
145
|
module.name_mapper='^@office-iss/react-native-win32/\(.*\)$' -> '<PROJECT_ROOT>\/1'
|
|
146
146
|
module.name_mapper='^@react-native/dev-middleware$' -> '<PROJECT_ROOT>/\1'
|
|
147
|
-
module.name_mapper='^@?[./a-zA-Z0-9$_-]+\.\(bmp\|gif\|jpg\|jpeg\|png\|psd\|svg\|webp\|m4v\|mov\|mp4\|mpeg\|mpg\|webm\|aac\|aiff\|caf\|m4a\|mp3\|wav\|html\|pdf\|xml\|ktx\)$' -> '<PROJECT_ROOT>/Libraries/Image/RelativeImageStub'
|
|
147
|
+
module.name_mapper='^@?[./a-zA-Z0-9$_-]+\.\(bmp\|gif\|jpg\|jpeg\|png\|psd\|svg\|webp\|m4v\|mov\|mp4\|mpeg\|mpg\|webm\|aac\|aiff\|caf\|m4a\|mp3\|wav\|html\|pdf\|xml\|ktx\|heic\|heif\)$' -> '<PROJECT_ROOT>/Libraries/Image/RelativeImageStub'
|
|
148
148
|
|
|
149
149
|
module.system.haste.module_ref_prefix=m#
|
|
150
150
|
|
|
@@ -175,4 +175,4 @@ untyped-import
|
|
|
175
175
|
untyped-type-import
|
|
176
176
|
|
|
177
177
|
[version]
|
|
178
|
-
^0.
|
|
178
|
+
^0.295.0
|
package/CHANGELOG.json
CHANGED
|
@@ -2,21 +2,57 @@
|
|
|
2
2
|
"name": "@office-iss/react-native-win32",
|
|
3
3
|
"entries": [
|
|
4
4
|
{
|
|
5
|
-
"date": "
|
|
6
|
-
"version": "0.
|
|
7
|
-
"tag": "@office-iss/react-native-win32_v0.
|
|
5
|
+
"date": "Mon, 06 Apr 2026 06:35:45 GMT",
|
|
6
|
+
"version": "0.84.0-preview.1",
|
|
7
|
+
"tag": "@office-iss/react-native-win32_v0.84.0-preview.1",
|
|
8
8
|
"comments": {
|
|
9
9
|
"prerelease": [
|
|
10
10
|
{
|
|
11
11
|
"author": "protikbiswas@microsoft.com",
|
|
12
12
|
"package": "@office-iss/react-native-win32",
|
|
13
|
-
"commit": "
|
|
14
|
-
"comment": "Promote 0.
|
|
13
|
+
"commit": "4708eb68f37a790791e873c8d873da78315a6c7f",
|
|
14
|
+
"comment": "Promote 0.84 to preview"
|
|
15
15
|
},
|
|
16
16
|
{
|
|
17
17
|
"author": "beachball",
|
|
18
18
|
"package": "@office-iss/react-native-win32",
|
|
19
|
-
"comment": "Bump react-native-platform-override to v0.
|
|
19
|
+
"comment": "Bump react-native-platform-override to v0.84.0-preview.1",
|
|
20
|
+
"commit": "not available"
|
|
21
|
+
}
|
|
22
|
+
]
|
|
23
|
+
}
|
|
24
|
+
},
|
|
25
|
+
{
|
|
26
|
+
"date": "Fri, 27 Mar 2026 03:00:07 GMT",
|
|
27
|
+
"version": "0.0.0-canary.310",
|
|
28
|
+
"tag": "@office-iss/react-native-win32_v0.0.0-canary.310",
|
|
29
|
+
"comments": {
|
|
30
|
+
"prerelease": [
|
|
31
|
+
{
|
|
32
|
+
"author": "66076509+vineethkuttan@users.noreply.github.com",
|
|
33
|
+
"package": "@office-iss/react-native-win32",
|
|
34
|
+
"commit": "e57c920b275ea89dfe7e372f7fed8b34f7ab81aa",
|
|
35
|
+
"comment": "Integrate 0.84.0-nightly-20260107-58bc6c3e3"
|
|
36
|
+
}
|
|
37
|
+
]
|
|
38
|
+
}
|
|
39
|
+
},
|
|
40
|
+
{
|
|
41
|
+
"date": "Wed, 25 Mar 2026 02:08:13 GMT",
|
|
42
|
+
"version": "0.0.0-canary.309",
|
|
43
|
+
"tag": "@office-iss/react-native-win32_v0.0.0-canary.309",
|
|
44
|
+
"comments": {
|
|
45
|
+
"prerelease": [
|
|
46
|
+
{
|
|
47
|
+
"author": "66076509+vineethkuttan@users.noreply.github.com",
|
|
48
|
+
"package": "@office-iss/react-native-win32",
|
|
49
|
+
"commit": "70ed4bc8ac65bb551143b97576dd24ccb6bba702",
|
|
50
|
+
"comment": "Integrate 0.84.0-nightly-20251212-dd390dbbe"
|
|
51
|
+
},
|
|
52
|
+
{
|
|
53
|
+
"author": "beachball",
|
|
54
|
+
"package": "@office-iss/react-native-win32",
|
|
55
|
+
"comment": "Bump react-native-platform-override to v0.0.0-canary.1021",
|
|
20
56
|
"commit": "not available"
|
|
21
57
|
}
|
|
22
58
|
]
|
package/CHANGELOG.md
CHANGED
|
@@ -1,17 +1,34 @@
|
|
|
1
1
|
# Change Log - @office-iss/react-native-win32
|
|
2
2
|
|
|
3
|
-
<!-- This log was last generated on
|
|
3
|
+
<!-- This log was last generated on Mon, 06 Apr 2026 06:35:45 GMT and should not be manually modified. -->
|
|
4
4
|
|
|
5
5
|
<!-- Start content -->
|
|
6
6
|
|
|
7
|
-
## 0.
|
|
7
|
+
## 0.84.0-preview.1
|
|
8
8
|
|
|
9
|
-
|
|
9
|
+
Mon, 06 Apr 2026 06:35:45 GMT
|
|
10
10
|
|
|
11
11
|
### Changes
|
|
12
12
|
|
|
13
|
-
- Promote 0.
|
|
14
|
-
- Bump react-native-platform-override to v0.
|
|
13
|
+
- Promote 0.84 to preview (protikbiswas@microsoft.com)
|
|
14
|
+
- Bump react-native-platform-override to v0.84.0-preview.1
|
|
15
|
+
|
|
16
|
+
## 0.0.0-canary.310
|
|
17
|
+
|
|
18
|
+
Fri, 27 Mar 2026 03:00:07 GMT
|
|
19
|
+
|
|
20
|
+
### Changes
|
|
21
|
+
|
|
22
|
+
- Integrate 0.84.0-nightly-20260107-58bc6c3e3 (66076509+vineethkuttan@users.noreply.github.com)
|
|
23
|
+
|
|
24
|
+
## 0.0.0-canary.309
|
|
25
|
+
|
|
26
|
+
Wed, 25 Mar 2026 02:08:13 GMT
|
|
27
|
+
|
|
28
|
+
### Changes
|
|
29
|
+
|
|
30
|
+
- Integrate 0.84.0-nightly-20251212-dd390dbbe (66076509+vineethkuttan@users.noreply.github.com)
|
|
31
|
+
- Bump react-native-platform-override to v0.0.0-canary.1021
|
|
15
32
|
|
|
16
33
|
## 0.0.0-canary.308
|
|
17
34
|
|
|
@@ -23,6 +23,16 @@ function AccessibilityManagerTest(): React.Node {
|
|
|
23
23
|
"NativeAccessibilityManager doesn't exist",
|
|
24
24
|
);
|
|
25
25
|
|
|
26
|
+
const subscription = DeviceEventEmitter.addListener(
|
|
27
|
+
'didUpdateDimensions',
|
|
28
|
+
update => {
|
|
29
|
+
// some of the updates may come from lifecycle methods, which would carry different values than the ones we set
|
|
30
|
+
if (update.window.fontScale === 4.0) {
|
|
31
|
+
TestModule.markTestPassed(true);
|
|
32
|
+
}
|
|
33
|
+
},
|
|
34
|
+
);
|
|
35
|
+
|
|
26
36
|
NativeAccessibilityManager.setAccessibilityContentSizeMultipliers({
|
|
27
37
|
extraSmall: 1.0,
|
|
28
38
|
small: 2.0,
|
|
@@ -38,13 +48,6 @@ function AccessibilityManagerTest(): React.Node {
|
|
|
38
48
|
accessibilityExtraExtraExtraLarge: 12.0,
|
|
39
49
|
});
|
|
40
50
|
|
|
41
|
-
const subscription = DeviceEventEmitter.addListener(
|
|
42
|
-
'didUpdateDimensions',
|
|
43
|
-
update => {
|
|
44
|
-
TestModule.markTestPassed(update.window.fontScale === 4.0);
|
|
45
|
-
},
|
|
46
|
-
);
|
|
47
|
-
|
|
48
51
|
return () => {
|
|
49
52
|
subscription.remove();
|
|
50
53
|
};
|
|
@@ -32,14 +32,14 @@ const TESTS = ['only-if-cached', 'default', 'reload', 'force-cache'] as const;
|
|
|
32
32
|
|
|
33
33
|
function ImageCachePolicyTest(): React.Node {
|
|
34
34
|
const [state, setState] = useState<{[string]: ?boolean}>({
|
|
35
|
-
'only-if-cached': undefined,
|
|
36
35
|
default: undefined,
|
|
37
|
-
reload: undefined,
|
|
38
36
|
'force-cache': undefined,
|
|
37
|
+
'only-if-cached': undefined,
|
|
38
|
+
reload: undefined,
|
|
39
39
|
});
|
|
40
40
|
|
|
41
41
|
const testComplete = (
|
|
42
|
-
name:
|
|
42
|
+
name: NonNullable<ImageURISource['cache']>,
|
|
43
43
|
pass: boolean,
|
|
44
44
|
) => {
|
|
45
45
|
setState(prevState => ({
|
|
@@ -89,19 +89,19 @@ function ImageCachePolicyTest(): React.Node {
|
|
|
89
89
|
}
|
|
90
90
|
|
|
91
91
|
const getImageSource = (cache: ImageURISource['cache']) => ({
|
|
92
|
+
cache,
|
|
92
93
|
uri:
|
|
93
94
|
'https://raw.githubusercontent.com/facebook/react-native/HEAD/Libraries/NewAppScreen/components/logo.png?cacheBust=notinCache' +
|
|
94
95
|
Date.now(),
|
|
95
|
-
cache,
|
|
96
96
|
});
|
|
97
97
|
|
|
98
98
|
const styles = StyleSheet.create({
|
|
99
|
-
container: {
|
|
100
|
-
flex: 1,
|
|
101
|
-
},
|
|
102
99
|
base: {
|
|
103
|
-
width: 100,
|
|
104
100
|
height: 100,
|
|
101
|
+
width: 100,
|
|
102
|
+
},
|
|
103
|
+
container: {
|
|
104
|
+
flex: 1,
|
|
105
105
|
},
|
|
106
106
|
});
|
|
107
107
|
|
|
@@ -31,11 +31,11 @@ const TESTS = [
|
|
|
31
31
|
require('./WebSocketTest'),
|
|
32
32
|
require('./AccessibilityManagerTest'),
|
|
33
33
|
require('./GlobalEvalWithSourceUrlTest'),
|
|
34
|
-
];
|
|
34
|
+
].map(mod => mod.default);
|
|
35
35
|
|
|
36
36
|
TESTS.forEach(test =>
|
|
37
37
|
AppRegistry.registerComponent(
|
|
38
|
-
test.displayName || test.name || '',
|
|
38
|
+
(test as React.ComponentType<any>).displayName || test.name || '',
|
|
39
39
|
/* $FlowFixMe[incompatible-type] (>=0.54.0 site=react_native_fb,react_native_
|
|
40
40
|
* oss) This comment suppresses an error found when Flow v0.54 was deployed.
|
|
41
41
|
* To see the error delete this comment and run Flow. */
|
|
@@ -83,7 +83,7 @@ class IntegrationTestsApp extends React.Component<{...}, $FlowFixMe> {
|
|
|
83
83
|
*/
|
|
84
84
|
style={styles.row}>
|
|
85
85
|
<Text style={styles.testName}>
|
|
86
|
-
{test.displayName || test.name}
|
|
86
|
+
{(test as React.ComponentType<any>).displayName || test.name}
|
|
87
87
|
</Text>
|
|
88
88
|
</TouchableOpacity>,
|
|
89
89
|
<View style={styles.separator} />,
|
|
@@ -25,7 +25,7 @@ export type Mapping =
|
|
|
25
25
|
| AnimatedValue
|
|
26
26
|
| AnimatedValueXY;
|
|
27
27
|
export type EventConfig<T> = {
|
|
28
|
-
listener?: ?(NativeSyntheticEvent<T>) =>
|
|
28
|
+
listener?: ?(NativeSyntheticEvent<T>) => unknown,
|
|
29
29
|
useNativeDriver: boolean,
|
|
30
30
|
platformConfig?: PlatformConfig,
|
|
31
31
|
};
|
|
@@ -40,7 +40,7 @@ export function attachNativeEventImpl(
|
|
|
40
40
|
// key path inside the `nativeEvent` object. Ex.: ['contentOffset', 'x'].
|
|
41
41
|
const eventMappings: Array<EventMapping> = [];
|
|
42
42
|
|
|
43
|
-
const traverse = (value:
|
|
43
|
+
const traverse = (value: unknown, path: Array<string>) => {
|
|
44
44
|
if (value instanceof AnimatedValue) {
|
|
45
45
|
value.__makeNative(platformConfig);
|
|
46
46
|
|
|
@@ -151,9 +151,7 @@ export default class Animation {
|
|
|
151
151
|
animatedValue.__onAnimatedValueUpdateReceived(value, offset);
|
|
152
152
|
|
|
153
153
|
const isJsSyncRemoved =
|
|
154
|
-
ReactNativeFeatureFlags.cxxNativeAnimatedEnabled()
|
|
155
|
-
!ReactNativeFeatureFlags.disableFabricCommitInCXXAnimated() &&
|
|
156
|
-
ReactNativeFeatureFlags.cxxNativeAnimatedRemoveJsSync();
|
|
154
|
+
ReactNativeFeatureFlags.cxxNativeAnimatedEnabled();
|
|
157
155
|
if (!isJsSyncRemoved) {
|
|
158
156
|
if (this.__isLooping === true) {
|
|
159
157
|
return;
|
|
@@ -8,6 +8,7 @@
|
|
|
8
8
|
* @format
|
|
9
9
|
*/
|
|
10
10
|
|
|
11
|
+
import type {NativeColorValue} from '../StyleSheet/StyleSheetTypes';
|
|
11
12
|
import type AnimatedAddition from './nodes/AnimatedAddition';
|
|
12
13
|
import type AnimatedDiffClamp from './nodes/AnimatedDiffClamp';
|
|
13
14
|
import type AnimatedDivision from './nodes/AnimatedDivision';
|
|
@@ -28,7 +29,7 @@ import {useMemo} from 'react';
|
|
|
28
29
|
|
|
29
30
|
type Nullable = void | null;
|
|
30
31
|
type Primitive = string | number | boolean | symbol | void;
|
|
31
|
-
type Builtin = (...$ReadOnlyArray<empty>) =>
|
|
32
|
+
type Builtin = (...$ReadOnlyArray<empty>) => unknown | Date | Error | RegExp;
|
|
32
33
|
|
|
33
34
|
export type WithAnimatedValue<+T> = T extends Builtin | Nullable
|
|
34
35
|
? T
|
|
@@ -46,6 +47,7 @@ export type WithAnimatedValue<+T> = T extends Builtin | Nullable
|
|
|
46
47
|
| AnimatedInterpolation<number | string>
|
|
47
48
|
| AnimatedInterpolation<number>
|
|
48
49
|
| AnimatedInterpolation<string>
|
|
50
|
+
| AnimatedInterpolation<NativeColorValue>
|
|
49
51
|
: T extends $ReadOnlyArray<infer P>
|
|
50
52
|
? $ReadOnlyArray<WithAnimatedValue<P>>
|
|
51
53
|
: T extends {...}
|
|
@@ -87,10 +89,10 @@ export type AnimatedBaseProps<Props: {...}> = LooseOmit<
|
|
|
87
89
|
'ref',
|
|
88
90
|
>;
|
|
89
91
|
|
|
90
|
-
export type AnimatedComponentType<
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
);
|
|
92
|
+
export type AnimatedComponentType<
|
|
93
|
+
Props: {...},
|
|
94
|
+
+Instance = unknown,
|
|
95
|
+
> = component(ref?: React.RefSetter<Instance>, ...AnimatedProps<Props>);
|
|
94
96
|
|
|
95
97
|
export default function createAnimatedComponent<
|
|
96
98
|
TInstance: React.ComponentType<any>,
|
|
@@ -125,6 +127,7 @@ export function unstable_createAnimatedComponentWithAllowlist<
|
|
|
125
127
|
const [reducedProps, callbackRef] = useAnimatedProps<
|
|
126
128
|
TProps,
|
|
127
129
|
React.ElementRef<TInstance>,
|
|
130
|
+
// $FlowFixMe[incompatible-type]
|
|
128
131
|
>(props);
|
|
129
132
|
const ref = useMergeRefs<React.ElementRef<TInstance>>(
|
|
130
133
|
callbackRef,
|
|
@@ -12,6 +12,7 @@
|
|
|
12
12
|
|
|
13
13
|
'use strict';
|
|
14
14
|
|
|
15
|
+
import type {NativeColorValue} from '../../StyleSheet/StyleSheetTypes';
|
|
15
16
|
import type {PlatformConfig} from '../AnimatedPlatformConfig';
|
|
16
17
|
import type AnimatedNode from './AnimatedNode';
|
|
17
18
|
import type {AnimatedNodeConfig} from './AnimatedNode';
|
|
@@ -26,7 +27,14 @@ import invariant from 'invariant';
|
|
|
26
27
|
|
|
27
28
|
type ExtrapolateType = 'extend' | 'identity' | 'clamp';
|
|
28
29
|
|
|
29
|
-
export type
|
|
30
|
+
export type InterpolationConfigSupportedOutputType =
|
|
31
|
+
| number
|
|
32
|
+
| string
|
|
33
|
+
| NativeColorValue;
|
|
34
|
+
|
|
35
|
+
export type InterpolationConfigType<
|
|
36
|
+
OutputT: InterpolationConfigSupportedOutputType,
|
|
37
|
+
> = $ReadOnly<{
|
|
30
38
|
...AnimatedNodeConfig,
|
|
31
39
|
inputRange: $ReadOnlyArray<number>,
|
|
32
40
|
outputRange: $ReadOnlyArray<OutputT>,
|
|
@@ -82,6 +90,28 @@ function createNumericInterpolation(
|
|
|
82
90
|
};
|
|
83
91
|
}
|
|
84
92
|
|
|
93
|
+
function createPlatformColorInterpolation(
|
|
94
|
+
config: InterpolationConfigType<NativeColorValue>,
|
|
95
|
+
): (input: number) => NativeColorValue {
|
|
96
|
+
const outputRange = config.outputRange;
|
|
97
|
+
const outputRangeIndices = Array.from(Array(outputRange.length).keys());
|
|
98
|
+
const interpolateIndex = createNumericInterpolation({
|
|
99
|
+
...config,
|
|
100
|
+
inputRange: config.inputRange,
|
|
101
|
+
outputRange: outputRangeIndices,
|
|
102
|
+
});
|
|
103
|
+
|
|
104
|
+
return input => {
|
|
105
|
+
const interpolateResult = interpolateIndex(input);
|
|
106
|
+
if (!Number.isInteger(interpolateResult)) {
|
|
107
|
+
console.warn(
|
|
108
|
+
'PlatformColor interpolation should happen natively, here we fallback to the closest color',
|
|
109
|
+
);
|
|
110
|
+
}
|
|
111
|
+
return outputRange[Math.floor(interpolateResult)];
|
|
112
|
+
};
|
|
113
|
+
}
|
|
114
|
+
|
|
85
115
|
function interpolate(
|
|
86
116
|
input: number,
|
|
87
117
|
inputMin: number,
|
|
@@ -277,7 +307,7 @@ function findRange(input: number, inputRange: $ReadOnlyArray<number>) {
|
|
|
277
307
|
return i - 1;
|
|
278
308
|
}
|
|
279
309
|
|
|
280
|
-
function checkValidRanges<OutputT:
|
|
310
|
+
function checkValidRanges<OutputT: InterpolationConfigSupportedOutputType>(
|
|
281
311
|
inputRange: $ReadOnlyArray<number>,
|
|
282
312
|
outputRange: $ReadOnlyArray<OutputT>,
|
|
283
313
|
) {
|
|
@@ -304,7 +334,7 @@ function checkValidInputRange(arr: $ReadOnlyArray<number>) {
|
|
|
304
334
|
}
|
|
305
335
|
}
|
|
306
336
|
|
|
307
|
-
function checkInfiniteRange<OutputT:
|
|
337
|
+
function checkInfiniteRange<OutputT: InterpolationConfigSupportedOutputType>(
|
|
308
338
|
name: string,
|
|
309
339
|
arr: $ReadOnlyArray<OutputT>,
|
|
310
340
|
) {
|
|
@@ -322,7 +352,7 @@ function checkInfiniteRange<OutputT: number | string>(
|
|
|
322
352
|
}
|
|
323
353
|
|
|
324
354
|
export default class AnimatedInterpolation<
|
|
325
|
-
OutputT:
|
|
355
|
+
OutputT: InterpolationConfigSupportedOutputType,
|
|
326
356
|
> extends AnimatedWithChildren {
|
|
327
357
|
_parent: AnimatedNode;
|
|
328
358
|
_config: InterpolationConfigType<OutputT>;
|
|
@@ -347,6 +377,10 @@ export default class AnimatedInterpolation<
|
|
|
347
377
|
const config = this._config;
|
|
348
378
|
if (config.outputRange && typeof config.outputRange[0] === 'string') {
|
|
349
379
|
this._interpolation = (createStringInterpolation((config: any)): any);
|
|
380
|
+
} else if (typeof config.outputRange[0] === 'object') {
|
|
381
|
+
this._interpolation = (createPlatformColorInterpolation(
|
|
382
|
+
(config: any),
|
|
383
|
+
): any);
|
|
350
384
|
} else {
|
|
351
385
|
this._interpolation = (createNumericInterpolation((config: any)): any);
|
|
352
386
|
}
|
|
@@ -403,6 +437,8 @@ export default class AnimatedInterpolation<
|
|
|
403
437
|
return NativeAnimatedHelper.transformDataType(value);
|
|
404
438
|
}
|
|
405
439
|
}): any);
|
|
440
|
+
} else if (typeof outputRange[0] === 'object') {
|
|
441
|
+
outputType = 'platform_color';
|
|
406
442
|
}
|
|
407
443
|
|
|
408
444
|
return {
|
|
@@ -13,7 +13,7 @@ import type {PlatformConfig} from '../AnimatedPlatformConfig';
|
|
|
13
13
|
import NativeAnimatedHelper from '../../../src/private/animated/NativeAnimatedHelper';
|
|
14
14
|
import invariant from 'invariant';
|
|
15
15
|
|
|
16
|
-
type ValueListenerCallback = (state: {value: number, ...}) =>
|
|
16
|
+
type ValueListenerCallback = (state: {value: number, ...}) => unknown;
|
|
17
17
|
|
|
18
18
|
export type AnimatedNodeConfig = $ReadOnly<{
|
|
19
19
|
debugID?: string,
|
|
@@ -87,7 +87,7 @@ export default class AnimatedNode {
|
|
|
87
87
|
*
|
|
88
88
|
* See https://reactnative.dev/docs/animatedvalue#addlistener
|
|
89
89
|
*/
|
|
90
|
-
addListener(callback: (value: any) =>
|
|
90
|
+
addListener(callback: (value: any) => unknown): string {
|
|
91
91
|
const id = String(_uniqueId++);
|
|
92
92
|
this._listeners.set(id, callback);
|
|
93
93
|
return id;
|
|
@@ -172,7 +172,7 @@ export default class AnimatedNode {
|
|
|
172
172
|
* NOTE: This is intended to prevent `JSON.stringify` from throwing "cyclic
|
|
173
173
|
* structure" errors in React DevTools. Avoid depending on this!
|
|
174
174
|
*/
|
|
175
|
-
toJSON():
|
|
175
|
+
toJSON(): unknown {
|
|
176
176
|
return this.__getValue();
|
|
177
177
|
}
|
|
178
178
|
|
|
@@ -20,21 +20,26 @@ import {isValidElement} from 'react';
|
|
|
20
20
|
const MAX_DEPTH = 5;
|
|
21
21
|
|
|
22
22
|
export function isPlainObject(
|
|
23
|
-
value:
|
|
23
|
+
value: unknown,
|
|
24
24
|
/* $FlowFixMe[incompatible-type-guard] - Flow does not know that the prototype
|
|
25
25
|
and ReactElement checks preserve the type refinement of `value`. */
|
|
26
|
-
): value is $ReadOnly<{[string]:
|
|
26
|
+
): value is $ReadOnly<{[string]: unknown}> {
|
|
27
|
+
const proto =
|
|
28
|
+
value !== null && typeof value === 'object'
|
|
29
|
+
? Object.getPrototypeOf(value)
|
|
30
|
+
: undefined;
|
|
31
|
+
if (proto === undefined) {
|
|
32
|
+
// $FlowFixMe[incompatible-type-guard]
|
|
33
|
+
return false;
|
|
34
|
+
}
|
|
27
35
|
return (
|
|
28
36
|
// $FlowFixMe[incompatible-type-guard]
|
|
29
|
-
|
|
30
|
-
typeof value === 'object' &&
|
|
31
|
-
Object.getPrototypeOf(value).isPrototypeOf(Object) &&
|
|
32
|
-
!isValidElement(value)
|
|
37
|
+
(proto == null || proto.isPrototypeOf(Object)) && !isValidElement(value)
|
|
33
38
|
);
|
|
34
39
|
}
|
|
35
40
|
|
|
36
41
|
function flatAnimatedNodes(
|
|
37
|
-
value:
|
|
42
|
+
value: unknown,
|
|
38
43
|
nodes: Array<AnimatedNode> = [],
|
|
39
44
|
depth: number = 0,
|
|
40
45
|
): Array<AnimatedNode> {
|
|
@@ -83,13 +88,13 @@ function mapAnimatedNodes(value: any, fn: any => any, depth: number = 0): any {
|
|
|
83
88
|
|
|
84
89
|
export default class AnimatedObject extends AnimatedWithChildren {
|
|
85
90
|
_nodes: $ReadOnlyArray<AnimatedNode>;
|
|
86
|
-
_value:
|
|
91
|
+
_value: unknown;
|
|
87
92
|
|
|
88
93
|
/**
|
|
89
94
|
* Creates an `AnimatedObject` if `value` contains `AnimatedNode` instances.
|
|
90
95
|
* Otherwise, returns `null`.
|
|
91
96
|
*/
|
|
92
|
-
static from(value:
|
|
97
|
+
static from(value: unknown): ?AnimatedObject {
|
|
93
98
|
const nodes = flatAnimatedNodes(value);
|
|
94
99
|
if (nodes.length === 0) {
|
|
95
100
|
return null;
|
|
@@ -102,7 +107,7 @@ export default class AnimatedObject extends AnimatedWithChildren {
|
|
|
102
107
|
*/
|
|
103
108
|
constructor(
|
|
104
109
|
nodes: $ReadOnlyArray<AnimatedNode>,
|
|
105
|
-
value:
|
|
110
|
+
value: unknown,
|
|
106
111
|
config?: ?AnimatedNodeConfig,
|
|
107
112
|
) {
|
|
108
113
|
super(config);
|
|
@@ -116,7 +121,7 @@ export default class AnimatedObject extends AnimatedWithChildren {
|
|
|
116
121
|
});
|
|
117
122
|
}
|
|
118
123
|
|
|
119
|
-
__getValueWithStaticObject(staticObject:
|
|
124
|
+
__getValueWithStaticObject(staticObject: unknown): any {
|
|
120
125
|
const nodes = this._nodes;
|
|
121
126
|
let index = 0;
|
|
122
127
|
// NOTE: We can depend on `this._value` and `staticObject` sharing a
|
|
@@ -8,12 +8,15 @@
|
|
|
8
8
|
* @format
|
|
9
9
|
*/
|
|
10
10
|
|
|
11
|
+
import type {RootTag} from '../../Types/RootTagTypes';
|
|
11
12
|
import type {PlatformConfig} from '../AnimatedPlatformConfig';
|
|
12
13
|
import type {AnimatedNodeConfig} from './AnimatedNode';
|
|
13
14
|
import type {AnimatedStyleAllowlist} from './AnimatedStyle';
|
|
14
15
|
|
|
15
16
|
import NativeAnimatedHelper from '../../../src/private/animated/NativeAnimatedHelper';
|
|
17
|
+
import * as ReactNativeFeatureFlags from '../../../src/private/featureflags/ReactNativeFeatureFlags';
|
|
16
18
|
import {findNodeHandle} from '../../ReactNative/RendererProxy';
|
|
19
|
+
import {getNodeFromPublicInstance} from '../../ReactPrivate/ReactNativePrivateInterface';
|
|
17
20
|
import flattenStyle from '../../StyleSheet/flattenStyle';
|
|
18
21
|
import {AnimatedEvent} from '../AnimatedEvent';
|
|
19
22
|
import AnimatedNode from './AnimatedNode';
|
|
@@ -33,12 +36,12 @@ type TargetView = {
|
|
|
33
36
|
type TargetViewInstance = React.ElementRef<React.ElementType>;
|
|
34
37
|
|
|
35
38
|
function createAnimatedProps(
|
|
36
|
-
inputProps: {[string]:
|
|
39
|
+
inputProps: {[string]: unknown},
|
|
37
40
|
allowlist: ?AnimatedPropsAllowlist,
|
|
38
|
-
): [$ReadOnlyArray<string>, $ReadOnlyArray<AnimatedNode>, {[string]:
|
|
41
|
+
): [$ReadOnlyArray<string>, $ReadOnlyArray<AnimatedNode>, {[string]: unknown}] {
|
|
39
42
|
const nodeKeys: Array<string> = [];
|
|
40
43
|
const nodes: Array<AnimatedNode> = [];
|
|
41
|
-
const props: {[string]:
|
|
44
|
+
const props: {[string]: unknown} = {};
|
|
42
45
|
|
|
43
46
|
const keys = Object.keys(inputProps);
|
|
44
47
|
for (let ii = 0, length = keys.length; ii < length; ii++) {
|
|
@@ -95,13 +98,15 @@ export default class AnimatedProps extends AnimatedNode {
|
|
|
95
98
|
_callback: () => void;
|
|
96
99
|
_nodeKeys: $ReadOnlyArray<string>;
|
|
97
100
|
_nodes: $ReadOnlyArray<AnimatedNode>;
|
|
98
|
-
_props: {[string]:
|
|
101
|
+
_props: {[string]: unknown};
|
|
99
102
|
_target: ?TargetView = null;
|
|
103
|
+
_rootTag: ?RootTag = undefined;
|
|
100
104
|
|
|
101
105
|
constructor(
|
|
102
|
-
inputProps: {[string]:
|
|
106
|
+
inputProps: {[string]: unknown},
|
|
103
107
|
callback: () => void,
|
|
104
108
|
allowlist?: ?AnimatedPropsAllowlist,
|
|
109
|
+
rootTag?: RootTag,
|
|
105
110
|
config?: ?AnimatedNodeConfig,
|
|
106
111
|
) {
|
|
107
112
|
super(config);
|
|
@@ -110,10 +115,11 @@ export default class AnimatedProps extends AnimatedNode {
|
|
|
110
115
|
this._nodes = nodes;
|
|
111
116
|
this._props = props;
|
|
112
117
|
this._callback = callback;
|
|
118
|
+
this._rootTag = rootTag;
|
|
113
119
|
}
|
|
114
120
|
|
|
115
121
|
__getValue(): Object {
|
|
116
|
-
const props: {[string]:
|
|
122
|
+
const props: {[string]: unknown} = {};
|
|
117
123
|
|
|
118
124
|
const keys = Object.keys(this._props);
|
|
119
125
|
for (let ii = 0, length = keys.length; ii < length; ii++) {
|
|
@@ -138,7 +144,7 @@ export default class AnimatedProps extends AnimatedNode {
|
|
|
138
144
|
* created by this `AnimatedProps` instance.
|
|
139
145
|
*/
|
|
140
146
|
__getValueWithStaticProps(staticProps: Object): Object {
|
|
141
|
-
const props: {[string]:
|
|
147
|
+
const props: {[string]: unknown} = {...staticProps};
|
|
142
148
|
|
|
143
149
|
const keys = Object.keys(staticProps);
|
|
144
150
|
for (let ii = 0, length = keys.length; ii < length; ii++) {
|
|
@@ -149,7 +155,7 @@ export default class AnimatedProps extends AnimatedNode {
|
|
|
149
155
|
const staticStyle = staticProps.style;
|
|
150
156
|
const flatStaticStyle = flattenStyle(staticStyle);
|
|
151
157
|
if (maybeNode instanceof AnimatedStyle) {
|
|
152
|
-
const mutableStyle: {[string]:
|
|
158
|
+
const mutableStyle: {[string]: unknown} =
|
|
153
159
|
flatStaticStyle == null
|
|
154
160
|
? {}
|
|
155
161
|
: flatStaticStyle === staticStyle
|
|
@@ -190,7 +196,7 @@ export default class AnimatedProps extends AnimatedNode {
|
|
|
190
196
|
}
|
|
191
197
|
|
|
192
198
|
__getAnimatedValue(): Object {
|
|
193
|
-
const props: {[string]:
|
|
199
|
+
const props: {[string]: unknown} = {};
|
|
194
200
|
|
|
195
201
|
const nodeKeys = this._nodeKeys;
|
|
196
202
|
const nodes = this._nodes;
|
|
@@ -247,7 +253,9 @@ export default class AnimatedProps extends AnimatedNode {
|
|
|
247
253
|
super.__setPlatformConfig(platformConfig);
|
|
248
254
|
|
|
249
255
|
if (this._target != null) {
|
|
250
|
-
this
|
|
256
|
+
const target = this._target;
|
|
257
|
+
this.#connectAnimatedView(target);
|
|
258
|
+
this.#connectShadowNode(target);
|
|
251
259
|
}
|
|
252
260
|
}
|
|
253
261
|
}
|
|
@@ -256,9 +264,10 @@ export default class AnimatedProps extends AnimatedNode {
|
|
|
256
264
|
if (this._target?.instance === instance) {
|
|
257
265
|
return;
|
|
258
266
|
}
|
|
259
|
-
this._target = {instance, connectedViewTag: null};
|
|
267
|
+
const target = (this._target = {instance, connectedViewTag: null});
|
|
260
268
|
if (this.__isNative) {
|
|
261
|
-
this.#connectAnimatedView(
|
|
269
|
+
this.#connectAnimatedView(target);
|
|
270
|
+
this.#connectShadowNode(target);
|
|
262
271
|
}
|
|
263
272
|
}
|
|
264
273
|
|
|
@@ -279,6 +288,27 @@ export default class AnimatedProps extends AnimatedNode {
|
|
|
279
288
|
target.connectedViewTag = viewTag;
|
|
280
289
|
}
|
|
281
290
|
|
|
291
|
+
#connectShadowNode(target: TargetView): void {
|
|
292
|
+
if (
|
|
293
|
+
!ReactNativeFeatureFlags.cxxNativeAnimatedEnabled() ||
|
|
294
|
+
//eslint-disable-next-line
|
|
295
|
+
!ReactNativeFeatureFlags.useSharedAnimatedBackend()
|
|
296
|
+
) {
|
|
297
|
+
return;
|
|
298
|
+
}
|
|
299
|
+
|
|
300
|
+
invariant(this.__isNative, 'Expected node to be marked as "native"');
|
|
301
|
+
// $FlowExpectedError[incompatible-type] - target.instance may be an HTMLElement but we need ReactNativeElement for Fabric
|
|
302
|
+
const shadowNode = getNodeFromPublicInstance(target.instance);
|
|
303
|
+
if (shadowNode == null) {
|
|
304
|
+
return;
|
|
305
|
+
}
|
|
306
|
+
NativeAnimatedHelper.API.connectAnimatedNodeToShadowNodeFamily(
|
|
307
|
+
this.__getNativeTag(),
|
|
308
|
+
shadowNode,
|
|
309
|
+
);
|
|
310
|
+
}
|
|
311
|
+
|
|
282
312
|
#disconnectAnimatedView(target: TargetView): void {
|
|
283
313
|
invariant(this.__isNative, 'Expected node to be marked as "native"');
|
|
284
314
|
const viewTag = target.connectedViewTag;
|
|
@@ -318,6 +348,7 @@ export default class AnimatedProps extends AnimatedNode {
|
|
|
318
348
|
return {
|
|
319
349
|
type: 'props',
|
|
320
350
|
props: propsConfig,
|
|
351
|
+
rootTag: this._rootTag ?? undefined,
|
|
321
352
|
debugID: this.__getDebugID(),
|
|
322
353
|
};
|
|
323
354
|
}
|