GeekyAnts / GeekyAnts/NativeBase

Radio group doesn't read correct state

Open
#4,977 7 comments 3 reactions 1 assignee Assigned to @Viraj-10 View on GitHub
bug v3
Dominant language
TypeScript
Stars
20.4k
Forks
2.4k
PR merge metrics
No merged PRs in 30d

Description

### Description

Radio.Group onChange event doesn't have correct values of previous state, instead is has the initial state of the variable we're using. So deconstructing an object will result an override of the latest state of the variable

### CodeSandbox/Snack link

https://snack.expo.dev/dQWI2wSVm

### Steps to reproduce

1) create multiple FormControl in one screen
2) Create a Radio.Group inside FormControl
3) const [data, setData] = useState({});
4) update other Input's values like shown in docs
5) update Radio.Group value like shown in docs
6) Notice that the state of data variable has reset to initial value and upon updating it only has RadioGroup value

### NativeBase Version

3.3.x

### Platform

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

### Other Platform

_No response_

### Additional Information

Happens on 3.4.x

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.