mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2026-10-04 06:47:03 +00:00
Merge pull request #30564 from DefinitelyTyped/fix-react-native-on-ts-3.1
Fix react-native on TS 3.1+
This commit is contained in:
Vendored
+1
-1
@@ -5226,7 +5226,7 @@ export namespace StyleSheet {
|
||||
/**
|
||||
* Creates a StyleSheet style reference from the given object.
|
||||
*/
|
||||
export function create<T extends NamedStyles<T>>(styles: T): { [P in keyof T]: RegisteredStyle<T[P]> };
|
||||
export function create<T extends NamedStyles<T> | NamedStyles<any>>(styles: T): { [P in keyof T]: RegisteredStyle<T[P]> };
|
||||
|
||||
/**
|
||||
* Flattens an array of style objects, into one aggregated style object.
|
||||
|
||||
@@ -55,6 +55,7 @@ import {
|
||||
SectionListRenderItemInfo,
|
||||
Switch,
|
||||
RefreshControl,
|
||||
RegisteredStyle,
|
||||
TabBarIOS,
|
||||
NativeModules,
|
||||
MaskedViewIOS,
|
||||
@@ -175,6 +176,14 @@ const viewProperty = StyleSheet.flatten(viewStyle).backgroundColor;
|
||||
const textProperty = StyleSheet.flatten(textStyle).fontSize;
|
||||
const imageProperty = StyleSheet.flatten(imageStyle).resizeMode;
|
||||
|
||||
const s = StyleSheet.create({
|
||||
shouldWork: {
|
||||
fontWeight: '900', // if we comment this line, errors gone
|
||||
marginTop: 5, // if this line commented, errors also gone
|
||||
},
|
||||
})
|
||||
const f1: RegisteredStyle<TextStyle> = s.shouldWork
|
||||
|
||||
const testNativeSyntheticEvent = <T extends {}>(e: NativeSyntheticEvent<T>): void => {
|
||||
e.isDefaultPrevented();
|
||||
e.preventDefault();
|
||||
|
||||
Reference in New Issue
Block a user