Answer the question
In order to leave comments, you need to log in
Why don't links become active when using connect(mapStateToProps)(TaskMain)?
did like this, but now the url is changing and the components of this url are not substituted, what did you do wrong?
import { routerReducer } from 'react-router-redux';
let combinedReducer = combineReducers({
// редьюсер countersReducer отвечает за раздел state под именем counters
stateTaskLists: TaskReducer,
routing: routerReducer
// + другие редьюсеры
});
export default combinedReducer;
import TaskMain from './page/MainPage.js';
import combinedReducer from "./stores/stores.js";
import { syncHistoryWithStore } from 'react-router-redux';
import { Router } from 'react-router-dom';
import { createBrowserHistory } from 'history';
const store = createStore(combinedReducer);
export default store;
let history = syncHistoryWithStore(createBrowserHistory(), store);
ReactDOM.render(<Provider store={store}><Router history={history} ><TaskMain /></Router></Provider>, document.getElementById('root'));
ReactDOM.render(<Provider store={store}><TaskMain history={history} /></Provider>, document.getElementById('root'));
<BrowserRouter history={this.props.history}>
<Router history={this.props.history}>
Answer the question
In order to leave comments, you need to log in
Your project
1) The obsolete react-router-redax has been cut out
2) The export of the MenuTask and TaskMain components has been changed
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question