Skip to content

Commit 948d9eb

Browse files
committed
Fix invoke RadioButton onPress function
1 parent a246885 commit 948d9eb

File tree

2 files changed

+7
-2
lines changed

2 files changed

+7
-2
lines changed

lib/RadioGroup.tsx

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,12 @@ export default function RadioGroup({ containerStyle, layout = 'column', onPress,
3030
<RadioButton
3131
{...button}
3232
key={button.id}
33-
onPress={handlePress}
33+
onPress={(id: string) => {
34+
handlePress(id);
35+
if (button.onPress && typeof button.onPress === 'function') {
36+
button.onPress(id);
37+
}
38+
}}
3439
/>
3540
))}
3641
</View>

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "react-native-radio-buttons-group",
3-
"version": "2.2.6",
3+
"version": "2.2.7",
44
"description": "Simple and Best. An easy to use radio buttons for react native apps.",
55
"main": "./lib/index.ts",
66
"scripts": {

0 commit comments

Comments
 (0)