1
このチェックボックスをオンにすると、無効にするか、非表示にする方法はありますか?私は、チェックボックスがチェックボックスに応じてボタンを無効/非表示にする
をチェックされていないとき相続人は私のコードは
const renderCheckbox = ({ input, label }) =>
<FormControlLabel
control={
<Checkbox
{...input}
checked={input.value ? true : false}
onCheck={input.onChange}
/>
}
label={label}
/>
const CreateReport = (props) => {
const { handleSubmit, pristine, submitting } = props;
return (
<div className="create-report-form-container mobile-padding">
<form onSubmit={handleSubmit}>
<div>
<Field name="quotation-checkbox" component={renderCheckbox} label="Quotation to do" />
</div>
<div>
<Button raised color="accent" label="CreateQuotation">
Create a Quotation
</Button>
<Button raised color="accent" label="TakeNotes">
Take some notes
</Button>
</div>
<Button raised color="accent" type="submit" label="send" disabled={pristine || submitting}>
Send
</Button>
</form>
</div>
);
};
export default reduxForm({
form: 'CreateReport',
enableReinitialize: true,
})(CreateReport);
私は私が反応するのは非常に新たなんだとフロントエンドDEVごめんなさい。 isActive constを実行してから、renderCheckBoxがonChangeイベントでそれを使用するようにpropsとして渡すことを意味しますか? – Difender
私の回答が更新されました。 – Jules