@office-iss/react-native-win32 0.0.0-canary.257 → 0.0.0-canary.258
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 +4 -2
- package/CHANGELOG.json +40 -1
- package/CHANGELOG.md +20 -8
- package/Libraries/Components/ScrollView/ScrollView.js +124 -165
- package/Libraries/Core/InitializeCore.js +2 -0
- package/Libraries/Core/ReactNativeVersion.js +3 -3
- package/Libraries/Core/ReactNativeVersionCheck.win32.js +1 -1
- package/Libraries/Core/setUpGlobals.js +1 -0
- package/Libraries/LogBox/UI/LogBoxInspectorHeader.js +20 -8
- package/Libraries/LogBox/UI/LogBoxInspectorHeader.win32.js +20 -8
- package/Libraries/ReactNative/AppContainer-dev.js +1 -5
- package/Libraries/ReactNative/AppContainer-prod.js +1 -5
- package/Libraries/ReactNative/AppContainer.js +0 -1
- package/Libraries/ReactNative/AppRegistry.js +0 -6
- package/Libraries/ReactNative/renderApplication.js +0 -2
- package/Libraries/StyleSheet/StyleSheetTypes.d.ts +19 -0
- package/Libraries/StyleSheet/StyleSheetTypes.js +19 -1
- package/Libraries/StyleSheet/processFilter.js +214 -39
- package/Libraries/Text/Text.js +17 -2
- package/Libraries/Text/Text.win32.js +17 -2
- package/index.js +1 -0
- package/index.win32.js +1 -0
- package/jest/mockComponent.js +4 -1
- package/overrides.json +5 -5
- package/package.json +22 -22
- package/src/private/core/components/HScrollViewNativeComponents.js +55 -0
- package/src/private/core/components/VScrollViewNativeComponents.js +47 -0
- package/src/private/core/components/useSyncOnScroll.js +48 -0
- package/src/private/featureflags/ReactNativeFeatureFlags.js +12 -1
- package/src/private/featureflags/specs/NativeReactNativeFeatureFlags.js +2 -1
- package/src/private/specs/modules/NativeSampleTurboModule.js +14 -1
|
@@ -11,6 +11,7 @@
|
|
|
11
11
|
import type {PressEvent} from '../Types/CoreEventTypes';
|
|
12
12
|
import type {TextProps} from './TextProps';
|
|
13
13
|
|
|
14
|
+
import * as ReactNativeFeatureFlags from '../../src/private/featureflags/ReactNativeFeatureFlags';
|
|
14
15
|
import * as PressabilityDebug from '../Pressability/PressabilityDebug';
|
|
15
16
|
import usePressability from '../Pressability/usePressability';
|
|
16
17
|
import flattenStyle from '../StyleSheet/flattenStyle';
|
|
@@ -18,6 +19,7 @@ import processColor from '../StyleSheet/processColor';
|
|
|
18
19
|
import Platform from '../Utilities/Platform';
|
|
19
20
|
import TextAncestor from './TextAncestor';
|
|
20
21
|
import {NativeText, NativeVirtualText} from './TextNativeComponent';
|
|
22
|
+
import TextOptimized from './TextOptimized';
|
|
21
23
|
import * as React from 'react';
|
|
22
24
|
import {useContext, useMemo, useState} from 'react';
|
|
23
25
|
|
|
@@ -26,7 +28,7 @@ import {useContext, useMemo, useState} from 'react';
|
|
|
26
28
|
*
|
|
27
29
|
* @see https://reactnative.dev/docs/text
|
|
28
30
|
*/
|
|
29
|
-
const
|
|
31
|
+
const TextLegacy: React.AbstractComponent<
|
|
30
32
|
TextProps,
|
|
31
33
|
React.ElementRef<typeof NativeText | typeof NativeVirtualText>,
|
|
32
34
|
> = React.forwardRef((props: TextProps, forwardedRef) => {
|
|
@@ -340,7 +342,7 @@ const Text: React.AbstractComponent<
|
|
|
340
342
|
);
|
|
341
343
|
});
|
|
342
344
|
|
|
343
|
-
|
|
345
|
+
TextLegacy.displayName = 'TextLegacy';
|
|
344
346
|
|
|
345
347
|
/**
|
|
346
348
|
* Returns false until the first time `newValue` is true, after which this will
|
|
@@ -370,4 +372,17 @@ const verticalAlignToTextAlignVerticalMap = {
|
|
|
370
372
|
middle: 'center',
|
|
371
373
|
};
|
|
372
374
|
|
|
375
|
+
const Text: React.AbstractComponent<
|
|
376
|
+
TextProps,
|
|
377
|
+
React.ElementRef<typeof NativeText | typeof NativeVirtualText>,
|
|
378
|
+
> = React.forwardRef((props: TextProps, forwardedRef) => {
|
|
379
|
+
if (ReactNativeFeatureFlags.shouldUseOptimizedText()) {
|
|
380
|
+
return <TextOptimized {...props} ref={forwardedRef} />;
|
|
381
|
+
} else {
|
|
382
|
+
return <TextLegacy {...props} ref={forwardedRef} />;
|
|
383
|
+
}
|
|
384
|
+
});
|
|
385
|
+
|
|
386
|
+
Text.displayName = 'Text';
|
|
387
|
+
|
|
373
388
|
module.exports = Text;
|
package/index.js
CHANGED
package/index.win32.js
CHANGED
package/jest/mockComponent.js
CHANGED
|
@@ -16,7 +16,10 @@ module.exports = (moduleName, instanceMethods, isESModule) => {
|
|
|
16
16
|
const React = require('react');
|
|
17
17
|
|
|
18
18
|
const SuperClass =
|
|
19
|
-
typeof RealComponent === 'function'
|
|
19
|
+
typeof RealComponent === 'function' &&
|
|
20
|
+
RealComponent.prototype.constructor instanceof React.Component
|
|
21
|
+
? RealComponent
|
|
22
|
+
: React.Component;
|
|
20
23
|
|
|
21
24
|
const name =
|
|
22
25
|
RealComponent.displayName ||
|
package/overrides.json
CHANGED
|
@@ -7,19 +7,19 @@
|
|
|
7
7
|
"**/__snapshots__/**",
|
|
8
8
|
"src-win/rntypes/**"
|
|
9
9
|
],
|
|
10
|
-
"baseVersion": "0.
|
|
10
|
+
"baseVersion": "0.76.0-nightly-20240701-9f6cb21ed",
|
|
11
11
|
"overrides": [
|
|
12
12
|
{
|
|
13
13
|
"type": "derived",
|
|
14
14
|
"file": ".flowconfig",
|
|
15
15
|
"baseFile": ".flowconfig",
|
|
16
|
-
"baseHash": "
|
|
16
|
+
"baseHash": "2b0a3c4f44b686f254516c51469500bf26c5b113"
|
|
17
17
|
},
|
|
18
18
|
{
|
|
19
19
|
"type": "derived",
|
|
20
20
|
"file": "src-win/index.win32.js",
|
|
21
21
|
"baseFile": "packages/react-native/index.js",
|
|
22
|
-
"baseHash": "
|
|
22
|
+
"baseHash": "2690130ef7a40e3fb37fc465979e69b1036cdae8"
|
|
23
23
|
},
|
|
24
24
|
{
|
|
25
25
|
"type": "platform",
|
|
@@ -317,7 +317,7 @@
|
|
|
317
317
|
"type": "patch",
|
|
318
318
|
"file": "src-win/Libraries/LogBox/UI/LogBoxInspectorHeader.win32.js",
|
|
319
319
|
"baseFile": "packages/react-native/Libraries/LogBox/UI/LogBoxInspectorHeader.js",
|
|
320
|
-
"baseHash": "
|
|
320
|
+
"baseHash": "46b6ee5d65a0c820dd0a2415bd8f43e5e8807bae",
|
|
321
321
|
"issue": 7952
|
|
322
322
|
},
|
|
323
323
|
{
|
|
@@ -439,7 +439,7 @@
|
|
|
439
439
|
"type": "derived",
|
|
440
440
|
"file": "src-win/Libraries/Text/Text.win32.js",
|
|
441
441
|
"baseFile": "packages/react-native/Libraries/Text/Text.js",
|
|
442
|
-
"baseHash": "
|
|
442
|
+
"baseHash": "3b40ec7def4177ef81ad2eb84a0f95bc00cec041"
|
|
443
443
|
},
|
|
444
444
|
{
|
|
445
445
|
"type": "derived",
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@office-iss/react-native-win32",
|
|
3
|
-
"version": "0.0.0-canary.
|
|
3
|
+
"version": "0.0.0-canary.258",
|
|
4
4
|
"description": "Implementation of react native on top of Office's Win32 platform.",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -12,31 +12,31 @@
|
|
|
12
12
|
"types": "types",
|
|
13
13
|
"scripts": {
|
|
14
14
|
"build": "rnw-scripts build",
|
|
15
|
-
"bundle": "rnw-scripts prepareBundle && react-native bundle --platform win32 --entry-file ../react-native-win32-tester/js/RNTesterApp.win32.js --bundle-output dist/win32/dev/js/RNTesterApp.bundle --assets-dest dist/win32/dev --sourcemap-output ./dist/win32/dev/js/RNTesterApp.bundle.map",
|
|
15
|
+
"bundle": "rnw-scripts prepareBundle && npx @react-native-community/cli bundle --platform win32 --entry-file ../react-native-win32-tester/js/RNTesterApp.win32.js --bundle-output dist/win32/dev/js/RNTesterApp.bundle --assets-dest dist/win32/dev --sourcemap-output ./dist/win32/dev/js/RNTesterApp.bundle.map",
|
|
16
16
|
"clean": "rnw-scripts clean",
|
|
17
17
|
"flow-check": "rnw-scripts flow-check",
|
|
18
18
|
"lint:fix": "rnw-scripts lint:fix",
|
|
19
19
|
"lint": "rnw-scripts lint",
|
|
20
20
|
"run-win32-devmain": "npx @office-iss/rex-win32@0.71.15-devmain.16607.10000 --bundle js/RNTesterApp --component RNTesterApp --basePath ./dist/win32/dev --jsEngine v8 --useDevMain --useDirectDebugger --useFastRefresh",
|
|
21
21
|
"run-win32": "npx @office-iss/rex-win32@0.71.15-devmain.16607.10000 --bundle js/RNTesterApp --component RNTesterApp --basePath ./dist/win32/dev --jsEngine v8 --useDirectDebugger --useFastRefresh",
|
|
22
|
-
"start": "react-native start --projectRoot ../react-native-win32-tester",
|
|
22
|
+
"start": "npx @react-native-community/cli start --projectRoot ../react-native-win32-tester",
|
|
23
23
|
"test": "jest",
|
|
24
24
|
"validate-overrides": "react-native-platform-override validate"
|
|
25
25
|
},
|
|
26
26
|
"dependencies": {
|
|
27
27
|
"@babel/runtime": "^7.0.0",
|
|
28
28
|
"@jest/create-cache-key-function": "^29.6.3",
|
|
29
|
-
"@react-native-community/cli": "14.0.0-alpha.
|
|
30
|
-
"@react-native-community/cli-platform-android": "14.0.0-alpha.
|
|
31
|
-
"@react-native-community/cli-platform-ios": "14.0.0-alpha.
|
|
29
|
+
"@react-native-community/cli": "14.0.0-alpha.11",
|
|
30
|
+
"@react-native-community/cli-platform-android": "14.0.0-alpha.11",
|
|
31
|
+
"@react-native-community/cli-platform-ios": "14.0.0-alpha.11",
|
|
32
32
|
"@react-native/assets": "1.0.0",
|
|
33
|
-
"@react-native/assets-registry": "0.
|
|
34
|
-
"@react-native/codegen": "0.
|
|
35
|
-
"@react-native/community-cli-plugin": "0.
|
|
36
|
-
"@react-native/gradle-plugin": "0.
|
|
37
|
-
"@react-native/js-polyfills": "0.
|
|
38
|
-
"@react-native/normalize-colors": "0.
|
|
39
|
-
"@react-native/virtualized-lists": "0.
|
|
33
|
+
"@react-native/assets-registry": "0.76.0-nightly-20240701-9f6cb21ed",
|
|
34
|
+
"@react-native/codegen": "0.76.0-nightly-20240701-9f6cb21ed",
|
|
35
|
+
"@react-native/community-cli-plugin": "0.76.0-nightly-20240701-9f6cb21ed",
|
|
36
|
+
"@react-native/gradle-plugin": "0.76.0-nightly-20240701-9f6cb21ed",
|
|
37
|
+
"@react-native/js-polyfills": "0.76.0-nightly-20240701-9f6cb21ed",
|
|
38
|
+
"@react-native/normalize-colors": "0.76.0-nightly-20240701-9f6cb21ed",
|
|
39
|
+
"@react-native/virtualized-lists": "0.76.0-nightly-20240701-9f6cb21ed",
|
|
40
40
|
"abort-controller": "^3.0.0",
|
|
41
41
|
"anser": "^1.4.9",
|
|
42
42
|
"ansi-regex": "^5.0.0",
|
|
@@ -57,7 +57,7 @@
|
|
|
57
57
|
"pretty-format": "^26.5.2",
|
|
58
58
|
"promise": "^8.3.0",
|
|
59
59
|
"react-clone-referenced-element": "^1.0.1",
|
|
60
|
-
"react-devtools-core": "5.
|
|
60
|
+
"react-devtools-core": "^5.3.0",
|
|
61
61
|
"react-refresh": "^0.14.0",
|
|
62
62
|
"react-shallow-renderer": "^16.15.0",
|
|
63
63
|
"regenerator-runtime": "^0.13.2",
|
|
@@ -65,17 +65,17 @@
|
|
|
65
65
|
"semver": "^7.1.3",
|
|
66
66
|
"stacktrace-parser": "^0.1.10",
|
|
67
67
|
"whatwg-fetch": "^3.0.0",
|
|
68
|
-
"ws": "^6.2.
|
|
68
|
+
"ws": "^6.2.3",
|
|
69
69
|
"yargs": "^17.6.2"
|
|
70
70
|
},
|
|
71
71
|
"devDependencies": {
|
|
72
72
|
"@babel/core": "^7.20.0",
|
|
73
73
|
"@babel/eslint-parser": "^7.20.0",
|
|
74
|
-
"@react-native/metro-config": "0.
|
|
74
|
+
"@react-native/metro-config": "0.76.0-nightly-20240701-9f6cb21ed",
|
|
75
75
|
"@rnw-scripts/babel-react-native-config": "0.0.0",
|
|
76
|
-
"@rnw-scripts/eslint-config": "1.2.
|
|
77
|
-
"@rnw-scripts/jest-out-of-tree-snapshot-resolver": "^1.1.
|
|
78
|
-
"@rnw-scripts/just-task": "2.3.
|
|
76
|
+
"@rnw-scripts/eslint-config": "1.2.26",
|
|
77
|
+
"@rnw-scripts/jest-out-of-tree-snapshot-resolver": "^1.1.30",
|
|
78
|
+
"@rnw-scripts/just-task": "2.3.43",
|
|
79
79
|
"@rnw-scripts/metro-dev-config": "0.0.0",
|
|
80
80
|
"@rnx-kit/jest-preset": "^0.1.17",
|
|
81
81
|
"@types/node": "^18.0.0",
|
|
@@ -87,14 +87,14 @@
|
|
|
87
87
|
"just-scripts": "^1.3.3",
|
|
88
88
|
"prettier": "2.8.8",
|
|
89
89
|
"react": "19.0.0-rc-fb9a90fa48-20240614",
|
|
90
|
-
"react-native": "0.
|
|
91
|
-
"react-native-platform-override": "^1.9.
|
|
90
|
+
"react-native": "0.76.0-nightly-20240701-9f6cb21ed",
|
|
91
|
+
"react-native-platform-override": "^1.9.45",
|
|
92
92
|
"typescript": "5.0.4"
|
|
93
93
|
},
|
|
94
94
|
"peerDependencies": {
|
|
95
95
|
"@types/react": "^18.2.6",
|
|
96
96
|
"react": "^19.0.0-rc-fb9a90fa48-20240614",
|
|
97
|
-
"react-native": "0.
|
|
97
|
+
"react-native": "0.76.0-nightly-20240701-9f6cb21ed"
|
|
98
98
|
},
|
|
99
99
|
"beachball": {
|
|
100
100
|
"defaultNpmTag": "canary",
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
3
|
+
*
|
|
4
|
+
* This source code is licensed under the MIT license found in the
|
|
5
|
+
* LICENSE file in the root directory of this source tree.
|
|
6
|
+
*
|
|
7
|
+
* @flow strict-local
|
|
8
|
+
* @format
|
|
9
|
+
* @oncall react_native
|
|
10
|
+
*/
|
|
11
|
+
|
|
12
|
+
import type {ScrollViewNativeProps} from '../../../../Libraries/Components/ScrollView/ScrollViewNativeComponentType';
|
|
13
|
+
import type {ViewProps} from '../../../../Libraries/Components/View/ViewPropTypes';
|
|
14
|
+
import type {HostComponent} from '../../../../Libraries/Renderer/shims/ReactNativeTypes';
|
|
15
|
+
import type {TScrollViewNativeImperativeHandle} from './useSyncOnScroll';
|
|
16
|
+
|
|
17
|
+
import AndroidHorizontalScrollViewNativeComponent from '../../../../Libraries/Components/ScrollView/AndroidHorizontalScrollViewNativeComponent';
|
|
18
|
+
import ScrollContentViewNativeComponent from '../../../../Libraries/Components/ScrollView/ScrollContentViewNativeComponent';
|
|
19
|
+
import ScrollViewNativeComponent from '../../../../Libraries/Components/ScrollView/ScrollViewNativeComponent';
|
|
20
|
+
import Platform from '../../../../Libraries/Utilities/Platform';
|
|
21
|
+
import AndroidHorizontalScrollContentViewNativeComponent from '../../specs/components/AndroidHorizontalScrollContentViewNativeComponent';
|
|
22
|
+
import useSyncOnScroll from './useSyncOnScroll';
|
|
23
|
+
import * as React from 'react';
|
|
24
|
+
|
|
25
|
+
const HScrollViewNativeComponentForPlatform =
|
|
26
|
+
Platform.OS === 'android'
|
|
27
|
+
? AndroidHorizontalScrollViewNativeComponent
|
|
28
|
+
: ScrollViewNativeComponent;
|
|
29
|
+
|
|
30
|
+
export const HScrollViewNativeComponent: React.AbstractComponent<
|
|
31
|
+
ScrollViewNativeProps,
|
|
32
|
+
TScrollViewNativeImperativeHandle,
|
|
33
|
+
// $FlowExpectedError[incompatible-type] - Flow cannot model imperative handles, yet.
|
|
34
|
+
> = function HScrollViewNativeComponent(props: {
|
|
35
|
+
...ScrollViewNativeProps,
|
|
36
|
+
ref?: React.RefSetter<TScrollViewNativeImperativeHandle | null>,
|
|
37
|
+
...
|
|
38
|
+
}): React.Node {
|
|
39
|
+
const [ref, enableSyncOnScroll] = useSyncOnScroll(props.ref);
|
|
40
|
+
// NOTE: When `useSyncOnScroll` triggers an update, `props` will not have
|
|
41
|
+
// changed. Notably, `props.children` will be the same, allowing React to
|
|
42
|
+
// bail out during reconciliation.
|
|
43
|
+
return (
|
|
44
|
+
<HScrollViewNativeComponentForPlatform
|
|
45
|
+
{...props}
|
|
46
|
+
ref={ref}
|
|
47
|
+
enableSyncOnScroll={enableSyncOnScroll}
|
|
48
|
+
/>
|
|
49
|
+
);
|
|
50
|
+
};
|
|
51
|
+
|
|
52
|
+
export const HScrollContentViewNativeComponent: HostComponent<ViewProps> =
|
|
53
|
+
Platform.OS === 'android'
|
|
54
|
+
? AndroidHorizontalScrollContentViewNativeComponent
|
|
55
|
+
: ScrollContentViewNativeComponent;
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
3
|
+
*
|
|
4
|
+
* This source code is licensed under the MIT license found in the
|
|
5
|
+
* LICENSE file in the root directory of this source tree.
|
|
6
|
+
*
|
|
7
|
+
* @flow strict-local
|
|
8
|
+
* @format
|
|
9
|
+
* @oncall react_native
|
|
10
|
+
*/
|
|
11
|
+
|
|
12
|
+
import type {ScrollViewNativeProps} from '../../../../Libraries/Components/ScrollView/ScrollViewNativeComponentType';
|
|
13
|
+
import type {ViewProps} from '../../../../Libraries/Components/View/ViewPropTypes';
|
|
14
|
+
import type {HostComponent} from '../../../../Libraries/Renderer/shims/ReactNativeTypes';
|
|
15
|
+
import type {TScrollViewNativeImperativeHandle} from './useSyncOnScroll';
|
|
16
|
+
|
|
17
|
+
import ScrollContentViewNativeComponent from '../../../../Libraries/Components/ScrollView/ScrollContentViewNativeComponent';
|
|
18
|
+
import ScrollViewNativeComponent from '../../../../Libraries/Components/ScrollView/ScrollViewNativeComponent';
|
|
19
|
+
import View from '../../../../Libraries/Components/View/View';
|
|
20
|
+
import Platform from '../../../../Libraries/Utilities/Platform';
|
|
21
|
+
import useSyncOnScroll from './useSyncOnScroll';
|
|
22
|
+
import * as React from 'react';
|
|
23
|
+
|
|
24
|
+
export const VScrollViewNativeComponent: React.AbstractComponent<
|
|
25
|
+
ScrollViewNativeProps,
|
|
26
|
+
TScrollViewNativeImperativeHandle,
|
|
27
|
+
// $FlowExpectedError[incompatible-type] - Flow cannot model imperative handles, yet.
|
|
28
|
+
> = function VScrollViewNativeComponent(props: {
|
|
29
|
+
...ScrollViewNativeProps,
|
|
30
|
+
ref?: React.RefSetter<TScrollViewNativeImperativeHandle | null>,
|
|
31
|
+
...
|
|
32
|
+
}): React.Node {
|
|
33
|
+
const [ref, enableSyncOnScroll] = useSyncOnScroll(props.ref);
|
|
34
|
+
// NOTE: When `useSyncOnScroll` triggers an update, `props` will not have
|
|
35
|
+
// changed. Notably, `props.children` will be the same, allowing React to
|
|
36
|
+
// bail out during reconciliation.
|
|
37
|
+
return (
|
|
38
|
+
<ScrollViewNativeComponent
|
|
39
|
+
{...props}
|
|
40
|
+
ref={ref}
|
|
41
|
+
enableSyncOnScroll={enableSyncOnScroll}
|
|
42
|
+
/>
|
|
43
|
+
);
|
|
44
|
+
};
|
|
45
|
+
|
|
46
|
+
export const VScrollContentViewNativeComponent: HostComponent<ViewProps> =
|
|
47
|
+
Platform.OS === 'android' ? View : ScrollContentViewNativeComponent;
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
3
|
+
*
|
|
4
|
+
* This source code is licensed under the MIT license found in the
|
|
5
|
+
* LICENSE file in the root directory of this source tree.
|
|
6
|
+
*
|
|
7
|
+
* @flow strict-local
|
|
8
|
+
* @format
|
|
9
|
+
* @oncall react_native
|
|
10
|
+
*/
|
|
11
|
+
|
|
12
|
+
import type {ScrollViewNativeProps} from '../../../../Libraries/Components/ScrollView/ScrollViewNativeComponentType';
|
|
13
|
+
import type {HostComponent} from '../../../../Libraries/Renderer/shims/ReactNativeTypes';
|
|
14
|
+
|
|
15
|
+
import * as React from 'react';
|
|
16
|
+
import {useImperativeHandle, useRef, useState} from 'react';
|
|
17
|
+
|
|
18
|
+
export type TScrollViewNativeComponentInstance = React.ElementRef<
|
|
19
|
+
HostComponent<ScrollViewNativeProps>,
|
|
20
|
+
>;
|
|
21
|
+
|
|
22
|
+
export type TScrollViewNativeImperativeHandle = {
|
|
23
|
+
componentRef: React.RefObject<TScrollViewNativeComponentInstance | null>,
|
|
24
|
+
unstable_setEnableSyncOnScroll: (enabled: true) => void,
|
|
25
|
+
};
|
|
26
|
+
|
|
27
|
+
/**
|
|
28
|
+
* Hook used by `HScrollViewNativeComponent` and `VScrollViewNativeComponent`
|
|
29
|
+
* to make an implementation of `unstable_setEnableSyncOnScroll` available that
|
|
30
|
+
* does not require updating all `ScrollView` children.
|
|
31
|
+
*/
|
|
32
|
+
export default function useSyncOnScroll(
|
|
33
|
+
inputRef: ?React.RefSetter<TScrollViewNativeImperativeHandle | null>,
|
|
34
|
+
): [React.RefSetter<TScrollViewNativeComponentInstance | null>, true | void] {
|
|
35
|
+
const componentRef = useRef<TScrollViewNativeComponentInstance | null>(null);
|
|
36
|
+
const [enableSyncOnScroll, setEnableSyncOnScroll] = useState<true | void>();
|
|
37
|
+
|
|
38
|
+
useImperativeHandle<TScrollViewNativeImperativeHandle>(inputRef, () => {
|
|
39
|
+
return {
|
|
40
|
+
componentRef,
|
|
41
|
+
unstable_setEnableSyncOnScroll(enabled: true): void {
|
|
42
|
+
setEnableSyncOnScroll(enabled);
|
|
43
|
+
},
|
|
44
|
+
};
|
|
45
|
+
}, []);
|
|
46
|
+
|
|
47
|
+
return [componentRef, enableSyncOnScroll];
|
|
48
|
+
}
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
* This source code is licensed under the MIT license found in the
|
|
5
5
|
* LICENSE file in the root directory of this source tree.
|
|
6
6
|
*
|
|
7
|
-
* @generated SignedSource<<
|
|
7
|
+
* @generated SignedSource<<522f11a571457cb932f451cf81bd384a>>
|
|
8
8
|
* @flow strict-local
|
|
9
9
|
*/
|
|
10
10
|
|
|
@@ -32,6 +32,7 @@ export type ReactNativeFeatureFlagsJsOnly = {
|
|
|
32
32
|
enableAccessToHostTreeInFabric: Getter<boolean>,
|
|
33
33
|
isLayoutAnimationEnabled: Getter<boolean>,
|
|
34
34
|
shouldUseAnimatedObjectForTransform: Getter<boolean>,
|
|
35
|
+
shouldUseOptimizedText: Getter<boolean>,
|
|
35
36
|
shouldUseRemoveClippedSubviewsAsDefaultOnIOS: Getter<boolean>,
|
|
36
37
|
shouldUseSetNativePropsInFabric: Getter<boolean>,
|
|
37
38
|
};
|
|
@@ -51,6 +52,7 @@ export type ReactNativeFeatureFlags = {
|
|
|
51
52
|
enableMicrotasks: Getter<boolean>,
|
|
52
53
|
enableSynchronousStateUpdates: Getter<boolean>,
|
|
53
54
|
enableUIConsistency: Getter<boolean>,
|
|
55
|
+
fixMappingOfEventPrioritiesBetweenFabricAndReact: Getter<boolean>,
|
|
54
56
|
fixStoppedSurfaceRemoveDeleteTreeUIFrameCallbackLeak: Getter<boolean>,
|
|
55
57
|
forceBatchingMountItemsOnAndroid: Getter<boolean>,
|
|
56
58
|
fuseboxEnabledDebug: Getter<boolean>,
|
|
@@ -96,6 +98,11 @@ export const isLayoutAnimationEnabled: Getter<boolean> = createJavaScriptFlagGet
|
|
|
96
98
|
*/
|
|
97
99
|
export const shouldUseAnimatedObjectForTransform: Getter<boolean> = createJavaScriptFlagGetter('shouldUseAnimatedObjectForTransform', false);
|
|
98
100
|
|
|
101
|
+
/**
|
|
102
|
+
* Use optimized version of <Text /> component.
|
|
103
|
+
*/
|
|
104
|
+
export const shouldUseOptimizedText: Getter<boolean> = createJavaScriptFlagGetter('shouldUseOptimizedText', false);
|
|
105
|
+
|
|
99
106
|
/**
|
|
100
107
|
* removeClippedSubviews prop will be used as the default in FlatList on iOS to match Android
|
|
101
108
|
*/
|
|
@@ -150,6 +157,10 @@ export const enableSynchronousStateUpdates: Getter<boolean> = createNativeFlagGe
|
|
|
150
157
|
* Ensures that JavaScript always has a consistent view of the state of the UI (e.g.: commits done in other threads are not immediately propagated to JS during its execution).
|
|
151
158
|
*/
|
|
152
159
|
export const enableUIConsistency: Getter<boolean> = createNativeFlagGetter('enableUIConsistency', false);
|
|
160
|
+
/**
|
|
161
|
+
* Uses the default event priority instead of the discreet event priority by default when dispatching events from Fabric to React.
|
|
162
|
+
*/
|
|
163
|
+
export const fixMappingOfEventPrioritiesBetweenFabricAndReact: Getter<boolean> = createNativeFlagGetter('fixMappingOfEventPrioritiesBetweenFabricAndReact', false);
|
|
153
164
|
/**
|
|
154
165
|
* Fixes a leak in SurfaceMountingManager.mRemoveDeleteTreeUIFrameCallback
|
|
155
166
|
*/
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
* This source code is licensed under the MIT license found in the
|
|
5
5
|
* LICENSE file in the root directory of this source tree.
|
|
6
6
|
*
|
|
7
|
-
* @generated SignedSource<<
|
|
7
|
+
* @generated SignedSource<<6715ba4954b31464c591597c53a2a0de>>
|
|
8
8
|
* @flow strict-local
|
|
9
9
|
*/
|
|
10
10
|
|
|
@@ -34,6 +34,7 @@ export interface Spec extends TurboModule {
|
|
|
34
34
|
+enableMicrotasks?: () => boolean;
|
|
35
35
|
+enableSynchronousStateUpdates?: () => boolean;
|
|
36
36
|
+enableUIConsistency?: () => boolean;
|
|
37
|
+
+fixMappingOfEventPrioritiesBetweenFabricAndReact?: () => boolean;
|
|
37
38
|
+fixStoppedSurfaceRemoveDeleteTreeUIFrameCallbackLeak?: () => boolean;
|
|
38
39
|
+forceBatchingMountItemsOnAndroid?: () => boolean;
|
|
39
40
|
+fuseboxEnabledDebug?: () => boolean;
|
|
@@ -12,7 +12,10 @@ import type {
|
|
|
12
12
|
RootTag,
|
|
13
13
|
TurboModule,
|
|
14
14
|
} from '../../../../Libraries/TurboModule/RCTExport';
|
|
15
|
-
import type {
|
|
15
|
+
import type {
|
|
16
|
+
EventEmitter,
|
|
17
|
+
UnsafeObject,
|
|
18
|
+
} from '../../../../Libraries/Types/CodegenTypes';
|
|
16
19
|
|
|
17
20
|
import * as TurboModuleRegistry from '../../../../Libraries/TurboModule/TurboModuleRegistry';
|
|
18
21
|
|
|
@@ -21,7 +24,17 @@ export enum EnumInt {
|
|
|
21
24
|
B = 42,
|
|
22
25
|
}
|
|
23
26
|
|
|
27
|
+
export type ObjectStruct = {
|
|
28
|
+
a: number,
|
|
29
|
+
b: string,
|
|
30
|
+
c?: ?string,
|
|
31
|
+
};
|
|
32
|
+
|
|
24
33
|
export interface Spec extends TurboModule {
|
|
34
|
+
+onPress: EventEmitter<void>;
|
|
35
|
+
+onClick: EventEmitter<string>;
|
|
36
|
+
+onChange: EventEmitter<ObjectStruct>;
|
|
37
|
+
+onSubmit: EventEmitter<ObjectStruct[]>;
|
|
25
38
|
// Exported methods.
|
|
26
39
|
+getConstants: () => {|
|
|
27
40
|
const1: boolean,
|