Dong Lam Trien

Dong Lam Trien

  • 830
  • 986
  • 147.2k

How to use CheckBox in React Native ?

Jun 10 2024 6:55 AM

I added a CheckBox and ReactNative got the error
Render error: requireNativeComponent: "AndroidChecBox" was not found in the UIManager,
please help me troubleshoot where I wrote it wrong ? this is my code

import CheckBox from '@react-native-community/checkbox';
const [isCheck, setCheckBox] = useState(false); 

<View style={styles.CheckBoxContainer}>
    <CheckBox
    value={isCheckBox}
    onValueChange={setCheckBox}
             
    <Text style={styles.CheckBoxText}>Remember me</Text>
    <TouchableOpacity>
    <Text style={styles.forgotPassword}>Forgot password ?</Text>
    </TouchableOpacity>
</View>

 


Answers (2)