Merge pull request #28217 from brunolemos/disable-style-props

[react-native] Disable styles as props
This commit is contained in:
Eloy Durán
2018-08-20 11:12:30 +02:00
committed by GitHub
2 changed files with 2 additions and 35 deletions
+2 -10
View File
@@ -1919,7 +1919,7 @@ type AccessibilityTrait =
* @see https://facebook.github.io/react-native/docs/view.html#props
*/
export interface ViewProps
extends ViewPropsAndroid, ViewPropsIOS, GestureResponderHandlers, Touchable, AccessibilityProps, ViewStyle {
extends ViewPropsAndroid, ViewPropsIOS, GestureResponderHandlers, Touchable, AccessibilityProps {
/**
* This defines how far a touch event can start away from the view.
* Typical interface guidelines recommend touch targets that are at least
@@ -3605,7 +3605,7 @@ export interface ImageResolvedAssetSource {
/**
* @see https://facebook.github.io/react-native/docs/image.html
*/
export interface ImagePropsBase extends ImagePropsIOS, ImagePropsAndroid, AccessibilityProps, ImageStyle {
export interface ImagePropsBase extends ImagePropsIOS, ImagePropsAndroid, AccessibilityProps {
/**
* onLayout function
*
@@ -3720,14 +3720,6 @@ export interface ImagePropsBase extends ImagePropsIOS, ImagePropsAndroid, Access
* A static image to display while downloading the final image off the network.
*/
defaultSource?: ImageURISource | number;
/**
* Currently broken
* @see https://github.com/facebook/react-native/pull/19281
*/
width?: never;
height?: never;
tintColor?: never;
}
export interface ImageProps extends ImagePropsBase {
-25
View File
@@ -686,31 +686,6 @@ export class ImageBackgroundProps extends React.Component {
}
}
class StylePropsTest extends React.PureComponent {
render() {
const uri = 'https://seeklogo.com/images/T/typescript-logo-B29A3F462D-seeklogo.com.png'
return (
<View backgroundColor="lightgray" flex={1} overflow="scroll">
<Image
borderRadius={100}
// height={200}
margin={20}
overflow="visible" // ps: must fail if "scroll"
source={{ uri }}
style={{ width: 200, height: 200, tintColor: 'green', flexWrap: 'wrap-reverse' }}
// tintColor="green"
// width={200}
/>
<Text style={{ /* iOs only */ textTransform: 'capitalize' }}>
Text
</Text>
</View>
);
}
}
const listViewDataSourceTest = new ListView.DataSource({rowHasChanged: () => true})
class AccessibilityTest extends React.Component {