NativeBase
NativeBase copied to clipboard
Radio BROKEN in latest release
Description
Radio used to work, they no longer do in 3.3.7
CodeSandbox/Snack link
https://docs.nativebase.io/3.3.x/radio
Steps to reproduce
Just use template Radio.Group, it will crash with the following:
NativeBase Version
3.3.7
Platform
- [X] Android
- [ ] CRA
- [ ] Expo
- [ ] iOS
- [ ] Next
Other Platform
No response
Additional Information
No response
After further investigation; it seems that it breaks apart only for Radios that are not checked. If I keep only the checked one (controlled value), nothing break. So I would guess there is an issue with the svg handling of non-checked radioBox in your latest update.
HI @pierroo, I wasn't able to reproduce the issue, can you please share snack / codesandbox.
Sure, here it is:
const [value, setValue] = useState('')
<Radio.Group onChange={setValue} value={value} colorScheme="blue">
<VStack space={4} alignItems="flex-start" py="3" rounded="sm" w="full">
<Radio size="lg" value="female">Female</Radio>
<Radio size="lg" value="male">Male</Radio>
<Radio size="lg" value="nonbinary">Non Binary</Radio>
</VStack>
</Radio.Group>
And for example, if I only keep one child Radio (the one selected by default) then no error. As soon as a "non checke" radio is added in the list, it breaks with the message above.
Hi @pierroo, Which version are you using? I am using the latest version 3.4.3
and it's working fine for me.
I am using 3.4.3 Also, I have "react-native-svg": "^12.3.0", in my package.json, maybe there is a conflict of libraries if you are also using it for your radio button?
EDIT: I tried to uninstall the react-native-svg library, but then my app would break since apparently native-base relies on it. Which version are you using that works with native-base 3.4.3 on your end?
NEW EDIT: I rolled back to 3.2.2 where it seems to be working. (tried 3.3.7, but it also crashed there) I will wait for your update on the above before I consider updating again; which is a shame considering some updates were bring some performance improvements.
Hi @pierroo, I've react-native-svg: ^12.3.0
and native-base: ^3.4.3
version in my package.json and it's working fine for me.
Thank you. Does that mean end of investigation on your end? ( Genuine question so I know where to stand regarding this issue, although I have no clue why rolling back to older native base would work; which does make me believe is on native base end )
It would be great If you can provide snack / codesandbox for the issue.
Hi @pierroo, It's working fine with the native-base latest versions. feel free to re-open the issue.