Invalid prop 'checked' of type 'number' supplied to 'CheckBox', expected 'boolean'
See original GitHub issuePlease consider asking the question at our spectrum channel.
https://spectrum.chat/react-hook-form
Describe the question?
I am receiving the following error when attempting to use a CheckBox from React Native Elements with a Controller in React Native.
Invalid prop 'checked' of type 'number' supplied to 'CheckBox', expected 'boolean
The Controller documentation seems a little hazy. Am I using this correctly? It seems to be trying to pass the number 2263
to the checkbox, instead of a boolean value.
Code Snippet
<Controller
as={CheckBox}
control={control}
name="optIn"
valueName="checked"
onChangeName="onPress"
title="Opt In to Newsletter"
defaultValue={true}
/>
Do I somehow need to convert the value to a boolean and then pass it down?
Issue Analytics
- State:
- Created 4 years ago
- Comments:30 (12 by maintainers)
Top Results From Across the Web
Failed prop type: Invalid prop `value` of type `number ...
I have a postalCode and it is numeric value. I have set the keyboardType="numeric" on <TextInput /> but I still have this error...
Read more >Invalid prop 'value' of type 'number' supplied to 'TextInput'
In this case when the value is alphanumeric then the value is treated as a string but in the case of numeric, it...
Read more >invalid prop `value` of type `boolean` supplied to `checkbox ...
Knob component has issue with Invalid prop value of type string supplied to Knob, expected number and DatePicker component has similar issue Invalid...
Read more >invalid prop `rows` of type `object` supplied to `forwardref ...
Failed prop type: Invalid prop children of type array supplied to ForwardRef(ListItemIcon) , expected a single ReactElement. failed Proptypes. Open side panel.
Read more >How To Use PropTypes In React - Web Dev Simplified Blog
Warning: Failed prop type: Invalid prop age of type string supplied to Component , expected number . This is great since we can...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Ok. I’ll see how I go and let you know.
I have removed many of my replies here as well, apparently as my help is useless, so no point of keep them here too.