NativeBase icon indicating copy to clipboard operation
NativeBase copied to clipboard

Radio BROKEN in latest release

Open pierroo opened this issue 2 years ago • 8 comments

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: image

NativeBase Version

3.3.7

Platform

  • [X] Android
  • [ ] CRA
  • [ ] Expo
  • [ ] iOS
  • [ ] Next

Other Platform

No response

Additional Information

No response

pierroo avatar Apr 19 '22 11:04 pierroo

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.

pierroo avatar Apr 19 '22 14:04 pierroo

HI @pierroo, I wasn't able to reproduce the issue, can you please share snack / codesandbox.

ankit-tailor avatar Apr 20 '22 13:04 ankit-tailor

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.

pierroo avatar Apr 20 '22 13:04 pierroo

Hi @pierroo, Which version are you using? I am using the latest version 3.4.3 and it's working fine for me.

ankit-tailor avatar Apr 21 '22 06:04 ankit-tailor

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.

pierroo avatar Apr 21 '22 08:04 pierroo

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.

ankit-tailor avatar Apr 21 '22 11:04 ankit-tailor

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 )

pierroo avatar Apr 21 '22 11:04 pierroo

It would be great If you can provide snack / codesandbox for the issue.

ankit-tailor avatar Apr 22 '22 05:04 ankit-tailor

Hi @pierroo, It's working fine with the native-base latest versions. feel free to re-open the issue.

Viraj-10 avatar Sep 19 '22 11:09 Viraj-10