#reactjs #typescript #react-hooks #antd #react-functional-component
Вопрос:
Я столкнулся с некоторыми проблемами Предупреждение: getFieldDecorator
будет переопределено value
, поэтому, пожалуйста, не устанавливайте value
напрямую и используйте setFieldsValue
для его установки.
Пожалуйста, помогите мне…
{initialJobPropertiesApps amp;amp; initialJobPropertiesApps.map((types: any, i: number): React.ReactNode => (
<tr data-row-key={`index-${types.id i}` 1}>
<td style={{width:'40%'}}>{types.name}<br />
<h6>{types.details}</h6>
</td>
<td style={{width:'10%'}}>{types.default === "" ? "(blank)" : types.default}</td>
<td style={{width:'50%'}}>
{types.type === "boolean" ?
<Form.Item label="">{getFieldDecorator(
`${types.id}`, (formConfig.AppsRadios, {
initialValue: types.value,
}))(
<Radio.Group
//onChange={onAppsRadio}
name={'appsRadio'}
>
<Radio value="0">No </Radio>
<Radio value="1">Yes</Radio>
<Radio value="">User Account Setting</Radio>
</Radio.Group>)}
</Form.Item>
: types.type === "number" ?
<Form.Item label="">{getFieldDecorator(
`${types.id}`, (formConfig.AppsRadioss, {
initialValue: types.value,
}))(<Input type="text"
//onChange={onNumberChange}
/>)}
</Form.Item>
: types.pname === "JOB_TABLE" ?
<Form.Item label="">{getFieldDecorator(
`${types.id}`, (formConfig.JobTable, {
initialValue: types.activeTable,
}))(<Select
onChange={onJobTableChange}
style={{ minWidth: 200, maxWidth: 200 }}
>
{types.tables amp;amp; types.tables.map((jobTable: { value: React.Key | undefined; label: boolean | React.ReactChild | React.ReactFragment | React.ReactPortal | null | undefined; }) => {
return (
<Option value={jobTable.value} key={jobTable.value}>
{jobTable.label}
</Option >
);
}
)}
</Select>)}
</Form.Item>
: types.pname === "CHANGE_CURRENCY" ?
<><Form.Item label="" style={{paddingBottom:'0px', marginBottom:'0px'}}>
{getFieldDecorator(
`${types.id}`, (formConfig.AppsCheckboxINR, {
initialValue: types.value === "No conversion" ? '' : types.value,
}))(<Input
type="text"
name={'noconversion'}
disabled={conversion}
style={{paddingBottom:'0px', marginBottom:'0px'}}
/>)}
</Form.Item>
<Form.Item>
{getFieldDecorator('noconversion', {
initialValue: initialChecked,
})(<Checkbox onChange={onChangeINR} defaultChecked={initialChecked}>No conversion</Checkbox>)}
{getFieldDecorator(
'id_curr_val', (formConfig.IdCurrVal,{
initialValue: types.id,
}))(
<Input type="hidden" /> )}
</Form.Item>
</>
: types.pname === "email" ?
<>
<Form.Item label="">{getFieldDecorator(
`${types.id}`, (formConfig.Changevalue, {
initialValue: types.value,
}))(<Input type="text"/>)}
</Form.Item></>
: <Form.Item label="">{getFieldDecorator(
`${types.id}`, (formConfig.ChangevalueOther, {
initialValue: types.value,
}))(<Input type="text"/>)}
</Form.Item>}
<Form.Item label="" className={styles.hiddenFilds}>
{getFieldDecorator(
`pname_${types.id}`, (formConfig.Pnames, {
initialValue: types.pname,
}))(
<Input type="hidden" value={types.pname} />
)}
</Form.Item>
<Form.Item label="" className={styles.hiddenFilds}>
{getFieldDecorator(
`pval_${types.id}`, (formConfig.Pvals, {
initialValue: types.pval,
}))(
<Input type="hidden" value={types.pval} />
)}
</Form.Item>
</td>
))}