G
G
Grigory Dikiy2016-08-11 22:04:44
JavaScript
Grigory Dikiy, 2016-08-11 22:04:44

React-redux-router not working?

Hello, what could be the reason that routing is not working in a redux application. Used this tutorial . Actually the code itself:

import ReactDOM from 'react-dom';
import React from 'react';
import { createStore, combineReducers } from 'redux';
import { Provider } from 'react-redux';
import { Router, Route, browserHistory } from 'react-router';
import { syncHistoryWithStore, routerReducer } from 'react-router-redux';

import App from './containers/App.js';
import * as reducers from './reducers/Reducers';
import './main.scss';

const store = createStore(combineReducers({...reducers, routing: routerReducer}));
const history = syncHistoryWithStore(browserHistory, store);

ReactDOM.render(
  <Provider store={store}>
    <Router history={history}>
      <Route path='/' componen={App}></Route>
    </Router>
  </Provider>,
  document.getElementById('root')
);

app.js
import React from 'react';
import Sidebar from '../components/Sidebar';

export default class App extends React.Component {
  render() {
    return (
      <div className="app">
        <Sidebar />
        {this.props.children}
      </div>
    );
  }
}

Thanks in advance for any help

Answer the question

In order to leave comments, you need to log in

1 answer(s)
G
Grigory Dikiy, 2016-08-11
@frilix

Ashamed: componen -> component

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question