Skip to content

Commit d39b8a7

Browse files
committed
fix radioButton lint errors and generate types
1 parent b5fefd2 commit d39b8a7

File tree

2 files changed

+15
-7
lines changed

2 files changed

+15
-7
lines changed

generatedTypes/components/radioButton/RadioButton.d.ts

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import React from 'react';
2-
import { TextStyle, ImageSourcePropType, ImageStyle, ViewProps } from 'react-native';
2+
import { TextStyle, StyleProp, ImageSourcePropType, ImageStyle, ViewStyle, ViewProps } from 'react-native';
33
import { RadioGroupContextProps } from './RadioGroupContext';
44
export declare type RadioButtonProps = RadioGroupContextProps & ViewProps & {
55
/**
@@ -51,9 +51,13 @@ export declare type RadioButtonProps = RadioGroupContextProps & ViewProps & {
5151
*/
5252
iconOnRight?: boolean;
5353
/**
54-
* Should the content be rendered right to the button
55-
*/
54+
* Should the content be rendered right to the button
55+
*/
5656
contentOnRight?: boolean;
57+
/**
58+
* Additional styling for the container
59+
*/
60+
containerStyle?: StyleProp<ViewStyle>;
5761
};
5862
export declare type RadioButtonPropTypes = RadioButtonProps;
5963
declare const _default: React.ComponentClass<RadioGroupContextProps & ViewProps & {
@@ -106,9 +110,13 @@ declare const _default: React.ComponentClass<RadioGroupContextProps & ViewProps
106110
*/
107111
iconOnRight?: boolean | undefined;
108112
/**
109-
* Should the content be rendered right to the button
110-
*/
113+
* Should the content be rendered right to the button
114+
*/
111115
contentOnRight?: boolean | undefined;
116+
/**
117+
* Additional styling for the container
118+
*/
119+
containerStyle?: StyleProp<ViewStyle>;
112120
} & {
113121
useCustomTheme?: boolean | undefined;
114122
}, any>;

src/components/radioButton/RadioButton.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -229,7 +229,7 @@ class RadioButton extends PureComponent<Props, RadioButtonState> {
229229
renderIcon() {
230230
const {iconSource, iconStyle} = this.props;
231231
const style = [this.styles.image, iconStyle];
232-
return iconSource && <Image style={style} source={iconSource} />;
232+
return iconSource && <Image style={style} source={iconSource}/>;
233233
}
234234

235235
renderButton() {
@@ -249,7 +249,7 @@ class RadioButton extends PureComponent<Props, RadioButtonState> {
249249
}
250250

251251
render() {
252-
const {onPress, onValueChange, contentOnRight, style, containerStyle, ...others} = this.props;
252+
const {onPress, onValueChange, contentOnRight, containerStyle, ...others} = this.props;
253253
const Container = onPress || onValueChange ? TouchableOpacity : View;
254254

255255
return (

0 commit comments

Comments
 (0)