Я пытаюсь установить начальное значение своих радиокнопок в реагировать на родную, но всегда устанавливается значение «Нет», даже если значения разные.
...
import RadioForm from 'react-native-simple-radio-button';
...
render() {
...
const { CompanyPayFee, AllPropertiesTenantPortal } = this.state.myData;
const radio_props = [
{label: 'Yes ', value: 0 },
{label: 'No', value: 1 }
];
console.log(CompanyPayFee, AllPropertiesTenantPortal);
...
return (
...
<RadioForm
radio_props={radio_props}
initial={CompanyPayFee}
formHorizontal={true}
labelHorizontal={true}
buttonColor={'#2196f3'}
animation={true}
buttonSize={15}
onPress={(text) => this.onChangeSettings(text, 'CompanyPayFee')}
/>
...
<RadioForm
radio_props={radio_props}
initial={AllPropertiesTenantPortal}
formHorizontal={true}
labelHorizontal={true}
buttonColor={'#2196f3'}
animation={true}
buttonSize={15}
onPress={(text) => this.onChangeSettings(text, 'AllPropertiesTenantPortal')}
/>
...
);
}
console.log returning:
undefined undefined
undefined undefined
undefined undefined
0 1
0 1
Однако,
Может ли это быть из-за того, что начальное значение в журнале не определено? Но позже он изменится на 1 или 0.
Спасибо.