Merge pull request #28366 from DefinitelyTyped/fix-bad-assignments-react-user-code

Use StyleProp for style properties
This commit is contained in:
Daniel Rosenwasser
2018-08-25 13:47:18 -07:00
committed by GitHub
2 changed files with 10 additions and 9 deletions

View File

@@ -5,7 +5,7 @@
// TypeScript Version: 2.8
import * as React from 'react';
import { ViewStyle } from 'react-native';
import { StyleProp, ViewStyle } from 'react-native';
type DataKey = string | number;
@@ -44,17 +44,17 @@ interface SortableListProps {
/**
* style of HOC
*/
style?: ViewStyle
style?: StyleProp<ViewStyle>
/**
* these styles will be applied to the inner scroll view content container
*/
contentContainerStyle?: ViewStyle
contentContainerStyle?: StyleProp<ViewStyle>
/**
* these styles will be applied to the inner scroll view content container, excluding the header and footer
*/
innerContainerStyle?: ViewStyle
innerContainerStyle?: StyleProp<ViewStyle>
/**
* when true, the SortableList's children are arranged horizontally in a row instead of vertically in a column.

View File

@@ -9,6 +9,7 @@
import * as React from 'react';
import {
ViewStyle,
StyleProp,
NativeSyntheticEvent,
NativeScrollEvent,
} from 'react-native';
@@ -31,7 +32,7 @@ export interface SwiperState {
export interface SwiperProperties extends React.Props<Swiper> {
horizontal?: boolean;
style?: ViewStyle;
style?: StyleProp<ViewStyle>;
pagingEnabled?: boolean;
@@ -71,9 +72,9 @@ export interface SwiperProperties extends React.Props<Swiper> {
renderPagination?(index: number, total: number, thisObject: Swiper): JSX.Element;
dotStyle?: ViewStyle;
dotStyle?: StyleProp<ViewStyle>;
activeDotStyle?: ViewStyle;
activeDotStyle?: StyleProp<ViewStyle>;
activeDot?: JSX.Element;
@@ -87,9 +88,9 @@ export interface SwiperProperties extends React.Props<Swiper> {
width?: number;
paginationStyle?: ViewStyle;
paginationStyle?: StyleProp<ViewStyle>;
buttonWrapperStyle?: ViewStyle;
buttonWrapperStyle?: StyleProp<ViewStyle>;
nextButton?: JSX.Element;