NativeBase: WARN "We can not support a function callback..."
Description
We expected no console warning with minimal Checkbox.Group usage.
CodeSandbox/Snack link
no link
Steps to reproduce
export const CheckboxScreen = () => {
const [values, setValues] = useState(['test']);
return (
<View>
<Checkbox.Group onChange={v => setValues(v)} defaultValue={values}>
<Checkbox value={'test'}>Test</Checkbox>
</Checkbox.Group>
<Text>{values}</Text>
</View>
);
};
NativeBase Version
3.4.7
Platform
- Android
- CRA
- Expo
- iOS
- Next
Other Platform
No response
Additional Information
We are getting following warning “WARN We can not support a function callback. See Github Issues for details https://github.com/adobe/react-spectrum/issues/2320” when clicking the checkbox in the group. Without checkbox group there is no warning. Is this an issue or are we doing something wrong?
Versions:
- react-native: 0.67.4
About this issue
- Original URL
- State: open
- Created 2 years ago
- Reactions: 40
- Comments: 62
Use onToggle instead of onValueChange.
Having to source a third party checkbox because of a bug with a simple component, which has been around since June, or possibly longer. How utterly ridiculous is that?
3.4.17
Any news? Still present and kinda annoying.
+1 “native-base”: “3.4.9”, “react”: “17.0.2”, “react-native”: “0.68.2”,
+1 “react”: “18.1.0”, “react-native”: “0.70.5”, “native-base”: “^3.4.25”,
Should we abandon native base?
wow been 8 months and the issue still going
This issue was “closed this as completed in https://github.com/adobe/react-spectrum/pull/2304on Jan 11, 2022”
native-base is dependent on specific versions of @react-stately that have been superseded years ago
As for @react-spectrum (which contains @react-stately) there have been a number of subsequent releases:
Indeed on March 4, 2023 @mfarhankasmani made an update to solve this exact issue by updating @react-stately/checkbox to version 3.4.0 (also memoizes the function).
fix: CheckBox.Group bugs #5073 #5686 https://github.com/GeekyAnts/NativeBase/commit/ffbc6023565485d99734383d2c575aaa72d7f767
I’ve switched to https://github.com/WrathChaos/react-native-bouncy-checkbox instead. Simple, worked as expected. Barely need to look at the docs to use it.
Maybe NativeBase should look into implementing something a long that line. It’s just a checkbox, I was that close to just use 2 icons and bind it to a boolean.
+1 “react”: “18.0.0”, “react-native”: “0.69.4”, “native-base”: “^3.4.12”
+1 react-native 0.69.6, native base ^3.4.9
+1 rn 0.70
Same problem here!
Hi @Brma1048 , Thank you for reporting this issue. we will look into it.