[英]redux-form dynamic name does not change the reducer name
我正在使用這樣的redux形式:
<RenderForm
form={form.name}
elements={form.elements}
initialValues={form.initialValues}
method={form.method}
target={form.target}
validate={parseValidations(form.elements)}
enableReinitialize
keepDirtyOnReinitialize
{...props}
/>
和
const RenderForm = reduxForm()(Form);
和
const Form = ({ children, method, target, form, elements, msg, handleSubmit, onChange }) => (
<form
onSubmit={handleSubmit}
id={form && `form-${form}`}
method={method}
action={target}
onChange={onChange}
>
{ msg ? <IconTooltip
id={`info-${form.name}`}
content={msg.p}
title={msg.h}
top={30}
showStart
showMedium
/> : null}
<div>
{formFactory(elements.filter(e => !e.noBackground))}
</div>
<div>
{formFactory(elements.filter(e => e.noBackground))}
</div>
{children}
</form>
);
現在我的問題是-表單名稱更改時,它不會更改redux中的reducer。
例如,我在向導的第1步中有一個向導和名為category的表單->現在,我更改為向導的第2步,並且有一個名為amount的表單。 它將始終保持類別。
如何解決這個問題?
您是否已在http://redux-form.com/6.6.3/examples/wizard/上閱讀了有關如何構建向導表單的文檔?
文檔中提到,如果要構建向導,則需要將向導的每個頁面連接到相同的表單名稱,因此需要顯式指定。
也許可以解決您的問題?
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.