Я новичок в Redux так пытается получить это происходит в моем приложении - я получаю следующее сообщение об ошибке:Redux Setup | ReactJS | ES6
Uncaught TypeError: (0 , _index2.default) is not a function
Там не целая куча документации о том, как получить настройки Redux там. Я знаю об этом сайте: http://redux.js.org/, однако это не помогло.
Не уверен, что мне не хватает?
Вот мои файлы:
Client.js
//Client entry
//Application modules
import React from "react";
import { Provider } from "react-redux";
import ReactDOM from "react-dom";
import { Router, Route, IndexRoute, hashHistory } from "react-router";
import { createStore } from "redux";
import reducers from "./reducers/index";
//Application views
import Layout from "./components/Layout";
import ForgotPassword from "./containers/ForgotPassword/ForgotPassword";
import Login from "./containers/Login/Login";
import Register from "./containers/Register/Register";
const store = createStore(reducers());
const app = document.getElementById('app');
ReactDOM.render(
<Provider store={store}>
<Router history={hashHistory}>
<Route path="/" component={Layout} />
<Route path="/login" component={Login} />
<Route path="/register" component={Register} />
<Route path="/forgotpassword" component={ForgotPassword} />
</Router>
</Provider>,
app);
export default store;
Layout.js
import React, {Component} from "react";
import Footer from "./Footer/Footer";
import Header from "./Header/Header";
import Login from "../containers/Login/Login";
import Register from "../containers/Register/Register";
import ForgotPassword from "../containers/ForgotPassword/ForgotPassword";
export default class Layout extends Component {
constructor() {
super();
}
render() {
return (
<div>
<Header />
<Login />
<Register />
<ForgotPassword />
<Footer />
</div>
);
}
}
Редукторы/index.js
import { createStore, combineReducers } from "redux";
import { reducer as formReducer } from "redux-form";
const reducers = {
form: formReducer
}
const reducer = combineReducers(reducers);
const store = createStore(reducer);
export default reducers;
Почему 'createStore' дважды? Почему бы не «экспортировать редуктор по умолчанию»? – conor909