Skip to content

Commit 848cb39

Browse files
committed
Fix strict transform array element type
1 parent 22cfb5c commit 848cb39

5 files changed

Lines changed: 85 additions & 69 deletions

File tree

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@
3434
"test-release-local": "node ./scripts/release-testing/test-release-local.js",
3535
"test-ios": "./scripts/objc-test.sh test",
3636
"test-typescript-legacy": "tsc -p packages/react-native/__typetests__/tsconfig.legacy.json",
37-
"test-generated-typescript": "tsc -p packages/react-native/__typetests__/tsconfig.json",
37+
"test-generated-typescript": "tsc -p packages/react-native/__typetests__/tsconfig.json && tsc -p packages/react-native/__typetests__/tsconfig.strict.json",
3838
"test": "jest",
3939
"fantom": "./scripts/fantom.sh",
4040
"fantom-cli": "./scripts/fantom-cli.sh",

packages/react-native/Libraries/StyleSheet/private/_TransformStyle.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ type ValueOfUnion<T, K> = T extends any
2121
: empty
2222
: empty;
2323
type MergeUnion<T> = {
24-
[K in KeysOfUnion<T>]?: ValueOfUnion<T, K>,
24+
[K in KeysOfUnion<T>]: ValueOfUnion<T, K>,
2525
};
2626
type MaximumOneOf<T extends {...}> = Values<{
2727
[K in keyof T]: $Exact<{

packages/react-native/ReactNativeApi.d.ts

Lines changed: 67 additions & 67 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
* This source code is licensed under the MIT license found in the
55
* LICENSE file in the root directory of this source tree.
66
*
7-
* @generated SignedSource<<4406ddb15814262a7ccc2b56e9625d67>>
7+
* @generated SignedSource<<97cf311b604ea132d9f3040da30df606>>
88
*
99
* This file was generated by scripts/js-api/build-types/index.js.
1010
*/
@@ -2970,7 +2970,7 @@ declare type MeasureOnSuccessCallback = (
29702970
pageX: number,
29712971
pageY: number,
29722972
) => void
2973-
declare type MergeUnion<T> = { [K in KeysOfUnion<T>]?: ValueOfUnion<T, K> }
2973+
declare type MergeUnion<T> = { [K in KeysOfUnion<T>]: ValueOfUnion<T, K> }
29742974
declare type Message = {
29752975
readonly content: string
29762976
readonly substitutions: ReadonlyArray<{
@@ -5716,18 +5716,18 @@ export {
57165716
AccessibilityValue, // cf8bcb74
57175717
ActionSheetIOS, // b558559e
57185718
ActionSheetIOSOptions, // 1756eb5a
5719-
ActivityIndicator, // e43c68bb
5719+
ActivityIndicator, // 6fe64c22
57205720
ActivityIndicatorInstance, // a82dd4e7
5721-
ActivityIndicatorProps, // 619842eb
5721+
ActivityIndicatorProps, // 3a0dde72
57225722
Alert, // a398a509
57235723
AlertButton, // bf1a3b60
57245724
AlertButtonStyle, // ec9fb242
57255725
AlertOptions, // 8a116d2a
57265726
AlertType, // 5ab91217
57275727
AndroidKeyboardEvent, // e03becc8
5728-
Animated, // d74ec583
5728+
Animated, // 0ea041a5
57295729
AppConfig, // 35c0ca70
5730-
AppRegistry, // 1e8c5a00
5730+
AppRegistry, // d095375a
57315731
AppState, // 12012be5
57325732
AppStateEvent, // 80f034c3
57335733
AppStateStatus, // 447e5ef2
@@ -5739,8 +5739,8 @@ export {
57395739
BackPressEventName, // 4620fb76
57405740
BlurEvent, // 4ba4f941
57415741
BoxShadowValue, // b679703f
5742-
Button, // bc8f6464
5743-
ButtonInstance, // d94b4241
5742+
Button, // c47c3d7f
5743+
ButtonInstance, // 9d4aeacd
57445744
ButtonProps, // 21c5780c
57455745
Clipboard, // 41addb89
57465746
CodegenTypes, // ab4986cc
@@ -5759,9 +5759,9 @@ export {
57595759
DimensionsPayload, // 653bc26c
57605760
DisplayMetrics, // 1dc35cef
57615761
DisplayMetricsAndroid, // 872e62eb
5762-
DrawerLayoutAndroid, // 7843b7b5
5762+
DrawerLayoutAndroid, // 1df626d8
57635763
DrawerLayoutAndroidInstance, // c0694352
5764-
DrawerLayoutAndroidProps, // 0c1d6155
5764+
DrawerLayoutAndroidProps, // 559a879c
57655765
DrawerSlideEvent, // c4ab8fba
57665766
DropShadowValue, // e9df2606
57675767
DynamicColorIOS, // d96c228c
@@ -5777,9 +5777,9 @@ export {
57775777
EventSubscription, // b8d084aa
57785778
ExtendedExceptionData, // 5a6ccf5a
57795779
FilterFunction, // bf24c0e3
5780-
FlatList, // e1b005c7
5781-
FlatListInstance, // 2d1d8e45
5782-
FlatListProps, // 94fa2dc7
5780+
FlatList, // c90ca21c
5781+
FlatListInstance, // fd29f592
5782+
FlatListProps, // eac22f6c
57835783
FocusEvent, // 850f1517
57845784
FontVariant, // 7c7558bb
57855785
GestureResponderEvent, // 14d3e77a
@@ -5790,37 +5790,37 @@ export {
57905790
IEventEmitter, // fbef6131
57915791
IOSKeyboardEvent, // e67bfe3a
57925792
IgnorePattern, // ec6f6ece
5793-
Image, // 87b793a4
5794-
ImageBackground, // abfd6c1d
5795-
ImageBackgroundInstance, // 50bc4cb3
5796-
ImageBackgroundProps, // e04f173a
5793+
Image, // 60991e05
5794+
ImageBackground, // df5201d0
5795+
ImageBackgroundInstance, // 6ab5c98a
5796+
ImageBackgroundProps, // 39af2ae2
57975797
ImageErrorEvent, // 978933f4
57985798
ImageInstance, // 9a100753
57995799
ImageLoadEvent, // 77f0b718
58005800
ImageProgressEventIOS, // 445331a4
5801-
ImageProps, // c50cfe0d
5801+
ImageProps, // 8be72c07
58025802
ImagePropsAndroid, // ee00e1d5
5803-
ImagePropsBase, // fa3f8e21
5803+
ImagePropsBase, // f1cd3988
58045804
ImagePropsIOS, // 9e19c85d
58055805
ImageRequireSource, // 681d683b
58065806
ImageResizeMode, // d51106e2
58075807
ImageResolvedAssetSource, // f3060931
58085808
ImageSize, // 1c47cf88
58095809
ImageSource, // ea31cf4a
58105810
ImageSourcePropType, // f522e093
5811-
ImageStyle, // 4b7c1906
5811+
ImageStyle, // cfd4a062
58125812
ImageURISource, // 443d047c
5813-
InputAccessoryView, // 9695d393
5814-
InputAccessoryViewProps, // d94dc290
5813+
InputAccessoryView, // 2f2a00b3
5814+
InputAccessoryViewProps, // 4fd62ce8
58155815
InputModeOptions, // 4e8581b9
58165816
Insets, // e7fe432a
58175817
KeyDownEvent, // 5b147614
58185818
KeyEvent, // 20fa4267
58195819
KeyUpEvent, // 57f832c5
58205820
Keyboard, // 49414c97
5821-
KeyboardAvoidingView, // fbf69b90
5822-
KeyboardAvoidingViewInstance, // f6c63fc9
5823-
KeyboardAvoidingViewProps, // 8609524c
5821+
KeyboardAvoidingView, // df7ab4e7
5822+
KeyboardAvoidingViewInstance, // ceae4751
5823+
KeyboardAvoidingViewProps, // 409998b5
58245824
KeyboardEvent, // c3f895d4
58255825
KeyboardEventEasing, // af4091c8
58265826
KeyboardEventName, // 59299ad6
@@ -5845,10 +5845,10 @@ export {
58455845
MeasureInWindowOnSuccessCallback, // a285f598
58465846
MeasureLayoutOnSuccessCallback, // 3592502a
58475847
MeasureOnSuccessCallback, // 82824e59
5848-
Modal, // 252d448a
5848+
Modal, // 81a9aed7
58495849
ModalBaseProps, // c294cc46
58505850
ModalInstance, // d466ce77
5851-
ModalProps, // 757e7cec
5851+
ModalProps, // 07b44c2b
58525852
ModalPropsAndroid, // 515fb173
58535853
ModalPropsIOS, // 664ecb7e
58545854
ModeChangeEvent, // f64bf69d
@@ -5884,25 +5884,25 @@ export {
58845884
PointerEvent, // ff599afe
58855885
PressabilityConfig, // fea539a5
58865886
PressabilityEventHandlers, // c222648b
5887-
Pressable, // ed5391ac
5887+
Pressable, // 36dd7a73
58885888
PressableAndroidRippleConfig, // ee32eaca
58895889
PressableInstance, // eebfe911
5890-
PressableProps, // d6bfa55b
5890+
PressableProps, // 4a51922d
58915891
PressableStateCallbackType, // 9af36561
58925892
ProcessedColorValue, // 33f74304
5893-
ProgressBarAndroid, // 2dd6dbfd
5893+
ProgressBarAndroid, // 2b4dcc09
58945894
ProgressBarAndroidInstance, // ab545ef1
5895-
ProgressBarAndroidProps, // 07fa83a1
5895+
ProgressBarAndroidProps, // 658c2d04
58965896
PublicRootInstance, // 8040afd7
58975897
PublicTextInstance, // 6937c7bf
58985898
PushNotificationEventName, // 84e7e150
58995899
PushNotificationIOS, // b4d1fe78
59005900
PushNotificationPermissions, // c2e7ae4f
59015901
Rationale, // 5df1b1c1
59025902
ReactNativeVersion, // abd76827
5903-
RefreshControl, // 947cb880
5904-
RefreshControlInstance, // 55f1814a
5905-
RefreshControlProps, // eb2b1cbe
5903+
RefreshControl, // 608bc395
5904+
RefreshControlInstance, // 8c539f92
5905+
RefreshControlProps, // 9a6d88c3
59065906
RefreshControlPropsAndroid, // 8ac931ca
59075907
RefreshControlPropsIOS, // 72a36381
59085908
Registry, // 6c39216d
@@ -5911,27 +5911,27 @@ export {
59115911
Role, // af7b889d
59125912
RootTag, // 3cd10504
59135913
RootTagContext, // 38bfc8f6
5914-
RootViewStyleProvider, // 8792d506
5914+
RootViewStyleProvider, // 81854260
59155915
Runnable, // 594dd93a
59165916
Runnables, // 4367c557
5917-
SafeAreaView, // 9ce03f75
5917+
SafeAreaView, // f5d39a62
59185918
SafeAreaViewInstance, // 21dba39c
59195919
ScaledSize, // 07e417c7
59205920
ScrollEvent, // d7abdd0a
5921-
ScrollResponderType, // ba188eae
5921+
ScrollResponderType, // e92e663e
59225922
ScrollToLocationParamsType, // d7ecdad1
5923-
ScrollView, // 066a8597
5924-
ScrollViewImperativeMethods, // 904c66fd
5925-
ScrollViewInstance, // ccf4f341
5926-
ScrollViewProps, // b62913d1
5923+
ScrollView, // 494cd321
5924+
ScrollViewImperativeMethods, // 5a2982ec
5925+
ScrollViewInstance, // b9aa74e3
5926+
ScrollViewProps, // 9140a87a
59275927
ScrollViewPropsAndroid, // 02f3df2e
59285928
ScrollViewPropsIOS, // 807cb4f6
59295929
ScrollViewScrollToOptions, // 3313411e
59305930
SectionBase, // 9f13db00
5931-
SectionList, // ee3e7972
5931+
SectionList, // 18ffa1be
59325932
SectionListData, // 1a4de01a
5933-
SectionListInstance, // c9b991fe
5934-
SectionListProps, // 0e933318
5933+
SectionListInstance, // e893341c
5934+
SectionListProps, // 89f39360
59355935
SectionListRenderItem, // 715b2086
59365936
SectionListRenderItemInfo, // 4a48a922
59375937
Separators, // 6a45f7e3
@@ -5948,19 +5948,19 @@ export {
59485948
StatusBarProps, // c2a44d88
59495949
StatusBarStyle, // 78f53eea
59505950
StyleProp, // fa0e9b4a
5951-
StyleSheet, // 3c21ec63
5951+
StyleSheet, // ba63fb79
59525952
SubmitBehavior, // c4ddf490
5953-
Switch, // f495bab3
5953+
Switch, // 3ebc1d5f
59545954
SwitchChangeEvent, // 899635b1
59555955
SwitchInstance, // 3c50eec5
5956-
SwitchProps, // cadfd0c4
5956+
SwitchProps, // 1ce366e0
59575957
Systrace, // 626d178c
59585958
TVViewPropsIOS, // 330ce7b5
59595959
TargetedEvent, // 16e98910
59605960
TaskProvider, // 266dedf2
5961-
Text, // 09e783b9
5961+
Text, // 811c051e
59625962
TextContentType, // 239b3ecc
5963-
TextInput, // a2cc82d1
5963+
TextInput, // 9653bb61
59645964
TextInputAndroidProps, // 9ebbc103
59655965
TextInputBlurEvent, // b77af40e
59665966
TextInputChangeEvent, // f55eef98
@@ -5970,44 +5970,44 @@ export {
59705970
TextInputIOSProps, // fb3c9327
59715971
TextInputInstance, // 5a0c0e0d
59725972
TextInputKeyPressEvent, // 546c5d07
5973-
TextInputProps, // dd91ebaa
5973+
TextInputProps, // 3898a79f
59745974
TextInputSelectionChangeEvent, // e58f2abc
59755975
TextInputSubmitEditingEvent, // 6bcb2aa5
59765976
TextInstance, // 05463a96
59775977
TextLayoutEvent, // 3f54186f
5978-
TextProps, // 4a122c2b
5979-
TextStyle, // 6ad4307f
5978+
TextProps, // 2c6b1380
5979+
TextStyle, // c97450b2
59805980
ToastAndroid, // 88a8969a
5981-
TouchableHighlight, // 3a6eaed4
5981+
TouchableHighlight, // c2f4a92f
59825982
TouchableHighlightInstance, // b510c0eb
5983-
TouchableHighlightProps, // 00e100c4
5984-
TouchableNativeFeedback, // fe739e82
5985-
TouchableNativeFeedbackInstance, // 0877e3e4
5986-
TouchableNativeFeedbackProps, // 1d0c2f30
5987-
TouchableOpacity, // fe716ffc
5983+
TouchableHighlightProps, // 6ec564c4
5984+
TouchableNativeFeedback, // 90e03d08
5985+
TouchableNativeFeedbackInstance, // b6e03127
5986+
TouchableNativeFeedbackProps, // 7ff32246
5987+
TouchableOpacity, // 3d958c9a
59885988
TouchableOpacityInstance, // b186055b
5989-
TouchableOpacityProps, // a3b32b69
5990-
TouchableWithoutFeedback, // ed159ba7
5991-
TouchableWithoutFeedbackProps, // e613ed05
5992-
TransformsStyle, // 65e70f18
5989+
TouchableOpacityProps, // 5a245948
5990+
TouchableWithoutFeedback, // 13c8bdea
5991+
TouchableWithoutFeedbackProps, // 6c62efe0
5992+
TransformsStyle, // bd31025f
59935993
TurboModule, // dfe29706
59945994
TurboModuleRegistry, // 4ace6db2
59955995
UIManager, // afbcdf05
59965996
UTFSequence, // ad625158
59975997
Vibration, // 31e4bbf8
5998-
View, // 3e72139a
5998+
View, // 50ae1629
59995999
ViewInstance, // ffde5573
6000-
ViewProps, // 763271bb
6000+
ViewProps, // cc729728
60016001
ViewPropsAndroid, // 55e81851
60026002
ViewPropsIOS, // 58ee19bf
6003-
ViewStyle, // e45056b1
6003+
ViewStyle, // 0e8e5de4
60046004
VirtualViewMode, // 6be59722
60056005
VirtualizedList, // 68c7345e
60066006
VirtualizedListInstance, // 423ee7c0
6007-
VirtualizedListProps, // f51f4a42
6007+
VirtualizedListProps, // 977c1f57
60086008
VirtualizedSectionList, // 9fd9cd61
60096009
VirtualizedSectionListInstance, // 12b706d5
6010-
VirtualizedSectionListProps, // 8210f30a
6010+
VirtualizedSectionListProps, // f81ac929
60116011
WrapperComponentProvider, // 9ef54e61
60126012
codegenNativeCommands, // 628a7c0a
60136013
codegenNativeComponent, // 32a1bca6

packages/react-native/__typetests__/stylesheet-create.tsx

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
import * as React from 'react';
1111
// @ts-ignore
1212
import {View, StyleSheet, type ShadowStyleIOS} from 'react-native';
13+
import type {ViewStyle} from 'react-native';
1314

1415
export function App() {
1516
return <View style={styles.container} />;
@@ -53,3 +54,8 @@ const styles3 = StyleSheet.create({
5354
shadowOffset: shadowOffsetConst,
5455
},
5556
});
57+
58+
const transforms: ViewStyle['transform'] = [];
59+
transforms.forEach(transform => {
60+
Object.keys(transform);
61+
});
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
{
2+
"$schema": "https://json.schemastore.org/tsconfig",
3+
"extends": "./tsconfig.json",
4+
"compilerOptions": {
5+
"skipLibCheck": true,
6+
"strict": true
7+
},
8+
"files": ["stylesheet-create.tsx"],
9+
"include": []
10+
}

0 commit comments

Comments
 (0)