Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/reactjs/22.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Reactjs React Redux表单找不到“的表单”;“用户”;在商店里_Reactjs_React Redux_React Redux Form - Fatal编程技术网

Reactjs React Redux表单找不到“的表单”;“用户”;在商店里

Reactjs React Redux表单找不到“的表单”;“用户”;在商店里,reactjs,react-redux,react-redux-form,Reactjs,React Redux,React Redux Form,我得到一个例外: Uncaught Error: Unable to create Form component. Could not find form for "user" in the store. 这是我的reducers.js function initialUserState(state = {email: '', password: ''}) { return state; } const crmApp = combineReducers({ auth,

我得到一个例外:

 Uncaught Error: Unable to create Form component. Could not find form for "user" in the store.
这是我的reducers.js

function initialUserState(state = {email: '', password: ''}) {
    return state;
}

const crmApp = combineReducers({
    auth,
    user: initialUserState
});

export default crmApp;
let store = createStore(reducers);
console.log(store.getState());

ReactDOM.render(
    <Provider store={ store }>
        <App />
    </Provider>,
    document.getElementById('root')
);
这里是index.js

function initialUserState(state = {email: '', password: ''}) {
    return state;
}

const crmApp = combineReducers({
    auth,
    user: initialUserState
});

export default crmApp;
let store = createStore(reducers);
console.log(store.getState());

ReactDOM.render(
    <Provider store={ store }>
        <App />
    </Provider>,
    document.getElementById('root')
);
用户基本上是登录表单的模型

有人有办法解决这个问题吗?可能我在redux应用商店中把用户模型放错了


提前感谢。:)

您需要按照详细说明将redux表单添加到减速器中。你应该得到这样的结果

import { reducer as formReducer } from 'redux-form'

const crmApp = combineReducers({
    auth,
    user: initialUserState,
    form: formReducer
});

您还需要确保已在组件级别正确附加表单。但是,您没有发布组件的任何代码。

我在表单方面遵循了此指南。但下面并没有关于形状还原器和形状装饰的内容<代码>//修饰表单组件ContactForm=reduxForm({form:'contact'//此表单的唯一名称})(ContactForm)该链接是一个404链接,我让它工作:)下面是combineReducers的代码:
const crmApp=combineReducers({auth,deep:combineForms({user:initialUserState},'deep')})我忘记了combineForms helper。@如果我相信这个答案是针对错误的react redux表单组件的。