フォームフィールドには何も入力できません。私は解決策を探しましたが、どれが問題を解決していないかはわかりませんでした。疑似問題を見ると、おそらく減速の問題です。だから私は何が間違っているの?使用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')
);
詳細を入力する必要があります。私はあなたのコードを複製し、期待どおりに動作します。ここでコードを見ることができます:https://www.webpackbin.com/bins/-Kf13qs_C-9323-46SGH。 –
エラーが生じますか? –
@DeividasKaržinauskastnxは私のコードに返信し、テストしています。それはあなたのために働くので、コードはうまくいくはずです。それは私のセットアップかもしれません。私はどんな詳細を提供すべきですか?これは非常にシンプルなアプリであり、それ以上のものはありません。 – BennievanderWel