Can't type in React input text field

后端 未结 8 2269
无人共我
无人共我 2020-12-02 11:56

I\'m trying my first bit of React.js and am stumped early on... I have the code below, which renders a search form into

. B
8条回答
  •  臣服心动
    2020-12-02 12:34

    I also have same problem and in my case I injected reducer properly but still I couldn't type in field. It turns out if you are using immutable you have to use redux-form/immutable.

    import {reducer as formReducer} from 'redux-form/immutable';
    const reducer = combineReducers{
    
        form: formReducer
    }
    import {Field, reduxForm} from 'redux-form/immutable';
    /* your component */
    

    Notice that your state should be like state->form otherwise you have to explicitly config the library also the name for state should be form. see this issue

提交回复
热议问题