2017-03-12 7 views
3

フォームフィールドには何も入力できません。私は解決策を探しましたが、どれが問題を解決していないかはわかりませんでした。疑似問題を見ると、おそらく減速の問題です。だから私は何が間違っているの?使用redux-formフィールドに入力できません

は:反応ルータ3.0.2

LoginForm.js

class LoginForm extends React.Component { 

    onSubmit(values) { 
     console.log(values.email) 
    } 

    render() { 

     var { handleSubmit } = this.props; // Provided by redux-form 

     return (
      <form onSubmit={handleSubmit(this.onSubmit.bind(this))}> 
       <label>E-mail</label> 
       <Field name='email' component='input' type='text' /> 
       <button type="submit">Login</button> 
      </form> 
     ) 
    } 
} 

const form = reduxForm({ 
    form: 'LoginForm' 
}) 

export default connect(mapStateToProps)(form(LoginForm)); 

reducers.js

const combinedReducers = combineReducers({ 
    form: formReducer 
}); 

export default combinedReducers; 

インデックス、Reduxの形6.5.0、15.4.2反応します。 js

const createStoreWithMiddleware = applyMiddleware(thunk)(createStore); 

// temp 
const Dashboard =() => { return <div>Dasboard</div> }; 

ReactDOM.render(
    <Provider store={createStoreWithMiddleware(combinedReducers)}> 
    <Router history={browserHistory}> 
     <Route path="/" component={LoginForm} /> 
     <Route pathp="dashboard" component={Dashboard} /> 
    </Router> 
    </Provider> 
    , 
    document.getElementById('app') 
); 
+0

詳細を入力する必要があります。私はあなたのコードを複製し、期待どおりに動作します。ここでコードを見ることができます:https://www.webpackbin.com/bins/-Kf13qs_C-9323-46SGH。 –

+0

エラーが生じますか? –

+0

@DeividasKaržinauskastnxは私のコードに返信し、テストしています。それはあなたのために働くので、コードはうまくいくはずです。それは私のセットアップかもしれません。私はどんな詳細を提供すべきですか?これは非常にシンプルなアプリであり、それ以上のものはありません。 – BennievanderWel

答えて

0

[OK]何が間違っていたのかわかりませんが、私が反応して反応を再インストールした後、反応還元型と還元型がすべて機能しました。

@DeividasKaržinauskasにTnxが助けて時間を割いています。彼の答えのおかげで、私はコードがOKであり、それが何か他のものでなければならないことを知っていました。

+0

'pathp'を除いて、私はあなたのコードに目障りなエラーは見られません。 –

関連する問題