react-native-material-ui
react-native-material-ui copied to clipboard
No callback occurs when checkbox pressed and No label rendered
this is my implementation,
<Checkbox
label="Remember Me"
checked={this.state.checked}
disabled={false}
onCheck={checked => {
this.setState({checked});
}}
/>
Hey @ant-tony-antony I couldn't reproduce your error. Just copied the same code you posted and the onCheck
worked fine. Could you provide more details about it?
I am having the exact same issue. Copying and pasting your code into a completely unstyled empty react component I have the same outcome; no label, and no events on change. Versions: "react-native": "~0.62.2", "react-native-material-ui": "^1.30.1"
Using TypeScript
I got it working. I played around with the styles on the parent view component and it seems you must have the "flex" property set to a value greater than 0. Try setting "flex: 1" on a parent View component.