{"id":278983,"date":"2016-04-25T13:20:03","date_gmt":"2016-04-25T09:20:03","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=278983"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=278983","title":{"rendered":"\u0422\u0435\u043a\u0441\u0442\u043e\u0432\u044b\u0439 \u0442\u0443\u0442\u043e\u0440\u0438\u0430\u043b \u043f\u043e react-router, \u0430 \u0442\u0430\u043a \u0436\u0435 react-router + redux. \u041d\u0430 \u0440\u0443\u0441\u0441\u043a\u043e\u043c"},"content":{"rendered":"\n<p>\u0412\u0441\u0435\u043c \u0434\u043e\u0431\u0440\u044b\u0439 \u0434\u0435\u043d\u044c. \u041d\u0435\u043c\u043d\u043e\u0433\u043e \u0441 \u0437\u0430\u0434\u0435\u0440\u0436\u043a\u043e\u0439, \u043d\u043e \u0432\u0441\u0435 \u0436\u0435 \u0432\u044b\u0445\u043e\u0434\u0438\u0442 <a href=\"https:\/\/www.gitbook.com\/book\/maxfarseer\/react-router-course-ru\/details\">\u0442\u0440\u0435\u0442\u0438\u0439 \u043c\u0438\u043d\u0438-\u0443\u0447\u0435\u0431\u043d\u0438\u043a<\/a>. \u041d\u0430 \u044d\u0442\u043e\u0442 \u0440\u0430\u0437 \u0440\u0430\u0437\u043e\u0431\u0440\u0430\u043d <a href=\"https:\/\/github.com\/reactjs\/react-router\">react-router<\/a>. \u0410 \u0442\u0430\u043a \u0436\u0435 \u0434\u0432\u0435 \u0433\u043b\u0430\u0432\u044b \u043f\u043e\u0441\u0432\u0435\u0449\u0435\u043d\u044b \u0438\u043d\u0442\u0435\u0433\u0440\u0430\u0446\u0438\u0438 react-router + <a href=\"http:\/\/redux.js.org\/\">redux<\/a>.<\/p>\n<p>  <\/p>\n<p>\u0412 \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u0435 \u0438\u043d\u0442\u0435\u0433\u0440\u0430\u0446\u0438\u0438 rr+redux \u044f <strong>\u043d\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043b<\/strong> <a href=\"https:\/\/github.com\/reactjs\/react-router-redux\">react-router-redux<\/a> \u0438 <a href=\"https:\/\/github.com\/acdlite\/redux-router\">redux-router<\/a>. \u041a\u0430\u043a \u0443\u043a\u0430\u0437\u0430\u043d\u043e \u0432 \u0441\u0430\u043c\u043e\u0439 \u043a\u043d\u0438\u0433\u0435, \u0438\u0437-\u0437\u0430 \u0430\u043a\u0442\u0438\u0432\u043d\u043e\u0433\u043e \u0440\u0430\u0437\u0432\u0438\u0442\u0438\u044f \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a, \u043c\u043d\u0435 \u0445\u043e\u0442\u0435\u043b\u043e\u0441\u044c \u0431\u044b \u00ab\u043d\u0430\u0443\u0447\u0438\u0442\u044c \u0432\u0430\u0441 \u0440\u044b\u0431\u0430\u0447\u0438\u0442\u044c\u00bb, \u0430 \u043d\u0435 \u043f\u0440\u043e\u0441\u0442\u043e \u00ab\u0434\u0430\u0442\u044c \u0440\u044b\u0431\u0443\u00bb.<\/p>\n<p>  <\/p>\n<p>\u0422\u0430\u043a\u0436\u0435, \u043f\u0440\u0438\u0432\u0435\u0434\u0435\u043d\u043d\u044b\u0439 \u0441\u043f\u043e\u0441\u043e\u0431 \u043f\u043e \u0438\u043d\u0442\u0435\u0433\u0440\u0430\u0446\u0438\u0438 \u043e\u0441\u043d\u043e\u0432\u0430\u043d \u043d\u0430 \u043b\u0438\u0447\u043d\u043e\u043c \u043e\u043f\u044b\u0442\u0435, \u043f\u043b\u044e\u0441 \u043e\u0442\u0432\u0435\u0442\u0430\u0445 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u0430 redux (<a href=\"https:\/\/twitter.com\/dan_abramov\">\u0435\u0433\u043e \u0442\u0432\u0438\u0442\u0442\u0435\u0440<\/a>) \u043d\u0430 SO, \u0438 \u0438\u0437\u0443\u0447\u0435\u043d\u0438\u0438 \u0440\u0430\u0437\u043b\u0438\u0447\u043d\u044b\u0445 \u0440\u0435\u043f\u043e\u0437\u0438\u0442\u043e\u0440\u0438\u0435\u0432. \u041e\u043d \u043d\u0435 \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u00ab\u0435\u0434\u0438\u043d\u0441\u0442\u0432\u0435\u043d\u043d\u043e \u0432\u0435\u0440\u043d\u044b\u043c\u00bb. \u041f\u043e\u0436\u0430\u043b\u0443\u0439\u0441\u0442\u0430, \u0443\u043a\u0430\u0436\u0438\u0442\u0435 \u0441\u0441\u044b\u043b\u043a\u0438 \u043d\u0430 \u0432\u0430\u0448\u0438 \u0440\u0435\u043f\u043e\u0437\u0438\u0442\u043e\u0440\u0438\u0438, \u043b\u0438\u0431\u043e \u043f\u0440\u0435\u0434\u043b\u043e\u0436\u0438\u0442\u0435 \u0441\u0432\u043e\u0438 \u0432\u0430\u0440\u0438\u0430\u043d\u0442\u044b \u0432 \u043a\u043e\u043c\u043c\u0435\u043d\u0442\u0430\u0440\u0438\u044f\u0445.<\/p>\n<p>  <\/p>\n<p>\u041f\u043e\u0435\u0445\u0430\u043b\u0438!<\/p>\n<p>  <\/p>\n<p><img decoding=\"async\" src=\"http:\/\/cs626129.vk.me\/v626129237\/5285\/mGCxPuP0btQ.jpg\" alt=\"book_screen\"\/><\/p>\n<p><a name=\"habracut\"><\/a>  <\/p>\n<h4>React-router<\/h4>\n<p>  <\/p>\n<p>\u0411\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0430 \u0432 \u0440\u0435\u043a\u043b\u0430\u043c\u0435 \u043d\u0435 \u043d\u0443\u0436\u0434\u0430\u0435\u0442\u0441\u044f. \u041c\u043e\u0449\u043d\u044b\u0435 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u0438 \u043f\u043e \u0432\u043b\u043e\u0436\u0435\u043d\u0438\u044e \u0440\u043e\u0443\u0442\u043e\u0432 (nesting) \u0438 \u0432 \u043f\u0440\u0438\u043d\u0446\u0438\u043f\u0435, \u0445\u043e\u0440\u043e\u0448\u0430\u044f \u0432\u044b\u0441\u043e\u043a\u043e\u0443\u0440\u043e\u0432\u043d\u0435\u0432\u0430\u044f \u0430\u0431\u0441\u0442\u0440\u0430\u043a\u0446\u0438\u044f.<\/p>\n<p>  <\/p>\n<p>\u0412 \u043e\u0441\u043d\u043e\u0432\u0435 \u043c\u0430\u0442\u0435\u0440\u0438\u0430\u043b\u0430 \u2013 \u043e\u0444\u0438\u0446\u0438\u0430\u043b\u044c\u043d\u044b\u0435 \u0442\u0443\u0442\u043e\u0440\u0438\u0430\u043b\u044b (<a href=\"https:\/\/github.com\/reactjs\/react-router-tutorial\/tree\/master\/lessons\">\u0440\u0430\u0437<\/a>, <a href=\"https:\/\/github.com\/reactjs\/react-router\/tree\/master\/docs\/guides\">\u0434\u0432\u0430<\/a>), \u0430 \u0442\u0430\u043a \u0436\u0435 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0431\u043b\u043e\u0433\u043e\u0432 (\u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u0431\u043b\u043e\u0433 <a href=\"http:\/\/jamesknelson.com\/routing-with-raw-react\/\">James K Nelson&#8217;a<\/a>).<\/p>\n<p>  <\/p>\n<p>\u0422\u0430\u043a \u0436\u0435 \u0432 \u0442\u0432\u0438\u0442\u0442\u0435\u0440\u0435 \u043f\u044b\u0442\u0430\u043b\u0438\u0441\u044c \u00ab\u0437\u0430\u0444\u043e\u0440\u0441\u0438\u0442\u044c\u00bb \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u0438\u0435 \u00ab<a href=\"http:\/\/knowbody.github.io\/react-router-docs\/\">\u043d\u0435\u043e\u0444\u0438\u0446\u0438\u0430\u043b\u044c\u043d\u043e\u0439 \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430\u0446\u0438\u0438<\/a>\u00bb, \u043d\u043e \u043f\u043e\u043a\u0430 \u0447\u0442\u043e \u043f\u0440\u043e\u0433\u0440\u0435\u0441\u0441 \u0442\u0430\u043c \u043f\u043e\u043b\u043d\u043e\u0441\u0442\u044c\u044e \u0441\u0442\u0438\u0445.<\/p>\n<p>  <\/p>\n<h4>React-router + redux<\/h4>\n<p>  <\/p>\n<p>\u041c\u043d\u043e\u0433\u0438\u0435 (\u043a\u0430\u043a \u0438 \u044f) \u0436\u0434\u0443\u0442 \u044d\u0442\u043e\u0433\u043e \u0440\u0430\u0437\u0434\u0435\u043b\u0430 \u0432 \u043e\u0444\u0438\u0446\u0438\u0430\u043b\u044c\u043d\u043e\u0439 \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430\u0446\u0438\u0438 redux. \u041d\u043e \u043f\u043e\u043a\u0430 \u044d\u0442\u043e\u0433\u043e \u043d\u0435 \u0441\u043b\u0443\u0447\u0438\u043b\u043e\u0441\u044c, \u043d\u0430 \u043f\u043e\u043c\u043e\u0449\u044c \u043f\u0440\u0438\u0445\u043e\u0434\u0438\u0442 \u00ab\u0444\u0438\u043b\u043e\u0441\u043e\u0444\u0438\u044f redux\u00bb + \u043a\u0440\u0443\u043f\u0438\u0446\u044b \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u0438 \u0440\u0430\u0437\u0431\u0440\u043e\u0441\u0430\u043d\u043d\u044b\u0435 \u043f\u043e \u0441\u0435\u0442\u0438.<\/p>\n<p>  <\/p>\n<p><em>\u0427\u0442\u043e \u044f \u0438\u043c\u0435\u044e \u0432\u0432\u0438\u0434\u0443 \u043f\u043e\u0434 \u00ab\u0444\u0438\u043b\u043e\u0441\u043e\u0444\u0438\u0435\u0439 redux\u00bb?<\/em><\/p>\n<p>  <\/p>\n<p><strong>\u0412\u043e-\u043f\u0435\u0440\u0432\u044b\u0445<\/strong>: \u0440\u043e\u0443\u0442\u0438\u043d\u0433 \u2013 \u044d\u0442\u043e \u00ab\u0434\u0435\u0439\u0441\u0442\u0432\u0438\u044f\u00bb (actions). <\/p>\n<p>  <\/p>\n<p><strong>\u0412\u043e-\u0432\u0442\u043e\u0440\u044b\u0445<\/strong>: \u043c\u044b \u043d\u0435 \u043c\u043e\u0436\u0435\u043c \u043f\u0440\u043e\u0441\u0442\u043e \u0432\u0437\u044f\u0442\u044c \u0438 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c <code>browserHistory.push<\/code> \u0432\u043d\u0443\u0442\u0440\u0438 \u0443\u0436\u0435 \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u044e\u0449\u0438\u0445 <em>actionCreators<\/em> (\u0444\u0443\u043d\u043a\u0446\u0438\u0439-\u0441\u043e\u0437\u0434\u0430\u0442\u0435\u043b\u0435\u0439 \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0439). \u041f\u043e\u0447\u0435\u043c\u0443? \u041f\u043e\u0442\u043e\u043c\u0443 \u0447\u0442\u043e \u2013 \u044d\u0442\u043e <strong>side-\u044d\u0444\u0444\u0435\u043a\u0442<\/strong>.<\/p>\n<p>  <\/p>\n<p>\u041d\u0430 \u043f\u043e\u043c\u043e\u0449\u044c \u043f\u0440\u0438\u0445\u043e\u0434\u0438\u0442 \u0438\u0434\u0435\u044f \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f middleware\u2019\u043e\u0432 (\u0444\u0443\u043d\u043a\u0446\u0438\u0439-\u043f\u0440\u043e\u0441\u043b\u043e\u0435\u043a). \u041d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u0445\u043e\u0447\u0435\u0442\u0441\u044f \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u043f\u0440\u0438\u043c\u0438\u0442\u0438\u0432\u043d\u044b\u0439 \u0432\u0430\u0440\u0438\u0430\u043d\u0442:<\/p>\n<p>  <\/p>\n<p><em>\u0415\u0441\u043b\u0438 action.redirect \u0435\u0441\u0442\u044c -&gt; browserHistory.push(nextUrl)<\/em>* <\/p>\n<p>  <\/p>\n<p>\u0414\u0430\u043d\u043d\u044b\u0439 \u043e\u0442\u0432\u0435\u0442 \u043d\u0430\u0440\u0443\u0448\u0430\u0435\u0442 \u0441\u043e\u0433\u043b\u0430\u0448\u0435\u043d\u0438\u0435, \u0447\u0442\u043e middleware \u043e\u0431\u044f\u0437\u0430\u043d \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0442\u044c next().<\/p>\n<p>  <\/p>\n<p>* \u044f \u0443\u0436\u0435 \u0432\u0442\u043e\u0440\u043e\u0439 \u0440\u0430\u0437 \u0443\u043f\u043e\u043c\u0438\u043d\u0430\u044e <a href=\"https:\/\/github.com\/reactjs\/react-router\/blob\/39a87cb777a44972683a3323c3adb86cef26797b\/modules\/index.js#L30\">browserHistory<\/a>. \u042d\u0442\u043e \u0441\u0432\u044f\u0437\u0430\u043d\u043e \u0441 \u0442\u0435\u043c, \u0447\u0442\u043e \u0434\u0430\u043d\u043d\u044b\u0435 \u043c\u0435\u0442\u043e\u0434\u044b (push, replace, \u0438 \u0442.\u0434.) \u0434\u043e\u0441\u0442\u0443\u043f\u043d\u044b \u043f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e, \u043a\u043e\u0433\u0434\u0430 \u0432\u044b \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0430\u0435\u0442\u0435 \u043d\u0430 \u043f\u0440\u043e\u0435\u043a\u0442 react-router.<\/p>\n<p>  <\/p>\n<p>\u0412 \u043f\u043e\u0438\u0441\u043a\u0430\u0445 \u043e\u0442\u0432\u0435\u0442\u0430 \u043d\u0430 \u0432\u043e\u043f\u0440\u043e\u0441, \u044f \u043f\u043e\u0441\u043c\u043e\u0442\u0440\u0435\u043b <a href=\"https:\/\/github.com\/acdlite\/redux-router\/blob\/master\/src\/historyMiddleware.js\">\u0433\u043b\u0443\u0431\u0436\u0435<\/a> \u0432 \u043a\u043e\u0434 redux-router. \u042f \u0445\u043e\u0442\u0435\u043b \u0434\u043e\u0441\u0442\u0438\u0447\u044c \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u0439 \u0446\u0435\u043b\u0438: \u0438\u043c\u0435\u0442\u044c \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044c \u0432\u044b\u0437\u044b\u0432\u0430\u0442\u044c \u0440\u043e\u0443\u0442\u0438\u043d\u0433 \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u043d\u0430\u0442\u0438\u0432\u043d\u043e\u0433\u043e \u0434\u043b\u044f redux \u2013 <strong>store.dispatch<\/strong><\/p>\n<p>  <\/p>\n<p>\u0422\u0430\u043a\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c \u043c\u044b \u0441\u043e\u0445\u0440\u0430\u043d\u044f\u0435\u043c \u00ab\u0444\u0438\u043b\u043e\u0441\u043e\u0444\u0438\u044e\u00bb. \u0412\u0435\u0441\u044c \u043f\u0440\u043e\u0446\u0435\u0441\u0441 \u00ab\u043f\u043e\u0442\u043e\u043a\u0430 \u0434\u0430\u043d\u043d\u044b\u0445\u00bb \u0432 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0438 \u0447\u0435\u0442\u043a\u043e \u043a\u043e\u043d\u0442\u0440\u043e\u043b\u0438\u0440\u0443\u0435\u0442\u0441\u044f \u043d\u0430\u043c\u0438.<\/p>\n<p>  <\/p>\n<p>\u0412 \u0442\u0443\u0442\u043e\u0440\u0438\u0430\u043b\u0435 \u0440\u0430\u0437\u043e\u0431\u0440\u0430\u043d\u0430 \u0431\u0430\u043d\u0430\u043b\u044c\u043d\u0430\u044f \u0437\u0430\u0434\u0430\u0447\u0430:<\/p>\n<p>  <\/p>\n<p>\u0415\u0441\u043b\u0438 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c \u0432\u0432\u0435\u043b \u043b\u043e\u0433\u0438\u043d \u2013 \u043f\u0435\u0440\u0435\u043d\u0430\u043f\u0440\u0430\u0432\u044c \u0435\u0433\u043e \u043d\u0430 <code>\/admin<\/code>, \u0435\u0441\u043b\u0438 \u0436\u0435 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c \u043d\u0435 \u0437\u0430\u043b\u043e\u0433\u0438\u043d\u0435\u043d \u0438 \u043f\u044b\u0442\u0430\u0435\u0442\u0441\u044f \u0437\u0430\u0439\u0442\u0438 \u043d\u0430 <code>\/admin<\/code> \u2013 \u043f\u0435\u0440\u0435\u043a\u0438\u043d\u044c \u0435\u0433\u043e \u043d\u0430 \u0444\u043e\u0440\u043c\u0443 \u0440\u0435\u0433\u0438\u0441\u0442\u0440\u0430\u0446\u0438\u0438 ( <code>\/login<\/code> ).<\/p>\n<p>  <\/p>\n<p>\u0414\u043b\u044f \u0443\u0441\u043f\u0435\u0448\u043d\u043e\u0433\u043e \u0440\u0435\u0448\u0435\u043d\u0438\u044f \u044d\u0442\u043e\u0439 \u0437\u0430\u0434\u0430\u0447\u0438 \u044f \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043b \u043a\u043e\u0434 <a href=\"https:\/\/github.com\/joshgeller\/react-redux-jwt-auth-example\">react-redux-jwt-auth-example<\/a>. \u041e\u0442\u043b\u0438\u0447\u043d\u0430\u044f \u0434\u0435\u043c\u043e\u043d\u0441\u0442\u0440\u0430\u0446\u0438\u044f \u043c\u043e\u0449\u043d\u043e\u0433\u043e \u043f\u0440\u0438\u0435\u043c\u0430 \u00ab\u043e\u0431\u043e\u0440\u0430\u0447\u0438\u0432\u0430\u043d\u0438\u044f \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u0430\u00bb.<\/p>\n<p>  <\/p>\n<p>\u0420\u0435\u0448\u0435\u043d\u0438\u0435 \u044d\u0442\u043e\u0439 \u0437\u0430\u0434\u0430\u0447\u0438 \u0438 \u0435\u0441\u0442\u044c \u043a\u043b\u044e\u0447 \u043a \u043f\u043e\u043d\u0438\u043c\u0430\u043d\u0438\u044e \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u0430 \u0432\u044b\u0437\u043e\u0432\u0430 \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0439, \u0441\u0432\u044f\u0437\u0430\u043d\u043d\u044b\u0445 \u0441 \u0440\u043e\u0443\u0442\u0438\u043d\u0433\u043e\u043c, \u0442\u0430\u043a \u043a\u0430\u043a \u0432\u0441\u0435 \u0437\u0430\u0434\u0430\u0447\u0438 &quot;\u043e\u043f\u0435\u0440\u044b&quot; redux + \u0440\u043e\u0443\u0442\u0438\u043d\u0433 \u0441\u0432\u043e\u0434\u044f\u0442\u0441\u044f \u043a \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u043c\u0443: \u043f\u043e\u043b\u0443\u0447\u0435\u043d \u043a\u0430\u043a\u043e\u0439-\u0442\u043e \u043e\u0442\u0432\u0435\u0442 (success, failure&#8230;) \u2014 \u043e\u0442\u043f\u0440\u0430\u0432\u044c (<em>dispatch<\/em>) \u0441\u043e\u0431\u044b\u0442\u0438\u0435 \u0440\u043e\u0443\u0442\u0438\u043d\u0433\u0430.<\/p>\n<p>  <\/p>\n<p><img decoding=\"async\" src=\"http:\/\/cs626129.vk.me\/v626129237\/527c\/-dHrUX_T-JQ.jpg\" alt=\"logger_screen\"\/><\/p>\n<p>  <\/p>\n<hr\/>\n<p>  <\/p>\n<p>\u0412\u043e\u043f\u0440\u043e\u0441 \u043a \u0445\u0430\u0431\u0440\u0430\u0436\u0438\u0442\u0435\u043b\u044f\u043c:<\/p>\n<p>  <\/p>\n<p>\u041a\u0430\u043a \u0434\u0443\u043c\u0430\u0435\u0442\u0435, \u043d\u0443\u0436\u043d\u043e \u043b\u0438 \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u0443\u044e \u0441\u0442\u0430\u0442\u044c\u044e \u0434\u043b\u044f \u043e\u043f\u0438\u0441\u0430\u043d\u0438\u044f \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u0430 \u0438\u043d\u0442\u0435\u0433\u0440\u0430\u0446\u0438\u0438 react-router + redux (\u043f\u043e \u0444\u0430\u043a\u0442\u0443 \u044d\u0442\u043e \u0440\u0430\u0437\u0434\u0435\u043b \u00ab\u041f\u043e\u0434\u043a\u043b\u044e\u0447\u0430\u0435\u043c redux\u00bb \u0438\u0437 \u0443\u0447\u0435\u0431\u043d\u0438\u043a\u0430. \u041e\u043d \u043a\u043e\u0440\u043e\u0442\u043a\u0438\u0439)? \u0414\u043b\u044f \u0447\u0435\u0433\u043e? \u0412\u043e\u0437\u043c\u043e\u0436\u043d\u043e, \u0434\u0440\u0443\u0433\u0438\u0435 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u0438, \u043a\u0442\u043e \u0434\u0430\u0432\u043d\u043e \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u0441 \u0442\u0430\u043a\u043e\u0439 \u0441\u0432\u044f\u0437\u043a\u043e\u0439 \u0443\u0432\u0438\u0434\u044f\u0442 \u043f\u043e\u0434\u0445\u043e\u0434 \u0438 \u043a\u043e\u0434 \u0441\u0440\u0430\u0437\u0443 \u0432 \u0441\u0442\u0430\u0442\u044c\u0435, \u0430 \u0441\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u043d\u043e, \u043f\u0440\u043e\u043a\u043e\u043c\u043c\u0435\u043d\u0442\u0438\u0440\u0443\u044e\u0442.<\/p>\n<p>  <\/p>\n<p>\u0412\u043d\u0438\u0437\u0443 \u043e\u043f\u0440\u043e\u0441.<\/p>\n<p>  <\/p>\n<hr\/>\n<p>  <\/p>\n<p>\u0418\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u044b\u0435 \u0432\u043e\u043f\u0440\u043e\u0441\u044b \u043d\u0430 SO:<\/p>\n<p>  <\/p>\n<p><a href=\"http:\/\/stackoverflow.com\/a\/36749963\/1916578\">You don\u2019t have to keep everything in the store<\/a><\/p>\n<p>  <\/p>\n<p>[Transition to another route on successful async redux action]( <a href=\"http:\/\/stackoverflow.com\/questions\/32612418\/transition-to-another-route-on-successful-async-redux-action\/32922381\">http:\/\/stackoverflow.com\/questions\/32612418\/transition-to-another-route-on-successful-async-redux-action\/32922381<\/a>)<\/p>\n<p>  <\/p>\n<p>[How to connect to redux store from react-router onEnter hook?]( <a href=\"http:\/\/stackoverflow.com\/questions\/33488090\/how-to-connect-to-redux-store-from-react-router-onenter-hook\">http:\/\/stackoverflow.com\/questions\/33488090\/how-to-connect-to-redux-store-from-react-router-onenter-hook<\/a>)<\/p>\n<p>  <\/p>\n<hr\/>\n<p>  <\/p>\n<p>\u041d\u0435\u043c\u043d\u043e\u0433\u043e \u0441\u0442\u0430\u0442\u0438\u0441\u0442\u0438\u043a\u0438 (\u043d\u0430 25.04.2016):<\/p>\n<p>  <\/p>\n<p><a href=\"https:\/\/www.gitbook.com\/book\/maxfarseer\/react-course-ru\/details\">React.js \u0434\u043b\u044f \u043d\u0430\u0447\u0438\u043d\u0430\u044e\u0449\u0438\u0445<\/a>: 59,481 \u043f\u0440\u043e\u0441\u043c\u043e\u0442\u0440\u043e\u0432, 8,245 \u043f\u043e\u0441\u0435\u0442\u0438\u0442\u0435\u043b\u0435\u0439, 3,843 \u0441\u043a\u0430\u0447\u0438\u0432\u0430\u043d\u0438\u0439 \u0432 \u0444\u043e\u0440\u043c\u0430\u0442\u0435 pdf\/epub\/mobi.<\/p>\n<p>  <\/p>\n<p><a href=\"https:\/\/www.gitbook.com\/book\/maxfarseer\/redux-course-ru\/details\">\u0422\u0443\u0442\u043e\u0440\u0438\u0430\u043b \u043f\u043e Redux \u043d\u0430 \u0440\u0443\u0441\u0441\u043a\u043e\u043c<\/a>: 66,978 \u043f\u0440\u043e\u0441\u043c\u043e\u0442\u0440\u043e\u0432, 7,942 \u043f\u043e\u0441\u0435\u0442\u0438\u0442\u0435\u043b\u0435\u0439, 2,832 \u0441\u043a\u0430\u0447\u0438\u0432\u0430\u043d\u0438\u0439.<\/p>\n<p>  <\/p>\n<p>\u041d\u0430 \u043e\u0431\u0430 \u043a\u0443\u0440\u0441\u0430 \u2013 41 + 38 \u00ab\u0434\u0438\u0441\u043a\u0443\u0441\u0441\u0438\u0439\u00bb. \u042d\u0442\u043e \u0432 \u043e\u0441\u043d\u043e\u0432\u043d\u043e\u043c \u0433\u0440\u0430\u043c\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438\u0435 \u043e\u0448\u0438\u0431\u043a\u0438. \u0415\u0441\u0442\u044c \u0442\u0430\u043a \u0436\u0435 \u043f\u0430\u0440\u0430 \u0434\u0435\u043b\u044c\u043d\u044b\u0445 \u0437\u0430\u043c\u0435\u0447\u0430\u043d\u0438\u0439 (<a href=\"https:\/\/habrahabr.ru\/post\/279249\/#comment_8807873\">\u043d\u0430 \u0445\u0430\u0431\u0440\u0435<\/a>).<\/p>\n<p>  <\/p>\n<p>\u042f \u0445\u043e\u0447\u0443 \u0441\u043a\u0430\u0437\u0430\u0442\u044c \u0432\u0441\u0435\u043c \u0431\u043e\u043b\u044c\u0448\u043e\u0435 \u0441\u043f\u0430\u0441\u0438\u0431\u043e \u0437\u0430 \u0432\u0430\u0448\u0435 \u0443\u0447\u0430\u0441\u0442\u0438\u0435 \u0438 \u0438\u043d\u0442\u0435\u0440\u0435\u0441. \u041f\u043e-\u043f\u0440\u0435\u0436\u043d\u0435\u043c\u0443 \u043d\u0430 \u0441\u0432\u044f\u0437\u0438: <a href=\"https:\/\/twitter.com\/MaxPatsiansky\">twitter<\/a>, \u043f\u043e\u0447\u0442\u0430 \u2014 maxfarseer[at]gmail.com<\/p>\n<p>  <\/p>\n<p>P.S. \u0430\u0432\u0442\u043e\u0440 \u043e\u0431\u043b\u043e\u0436\u043a\u0438 zirael_m[at]mail.ru (\u041c\u0430\u0440\u0438\u044f)<\/p>\n<div class=\"polling\">\n<form action=\"\/json\/polling\/\" class=\"poll\" method=\"post\">\n<div class=\"poll_title\">\u041d\u0443\u0436\u043d\u0430 \u043b\u0438 \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u0430\u044f \u0441\u0442\u0430\u0442\u044c\u044f React-router + redux?<\/div>\n<p>  \t\t<input type=\"hidden\" name=\"post_id\" value=\"282369\"\/> \t\t<input type=\"hidden\" name=\"polling_question_id\" value=\"14953\"\/>  \t\t<\/p>\n<table class=\"answer\">\n<tr>\n<td class=\"input\"> \t\t\t\t\t<input type=\"radio\" id=\"vv72947\" \t\t\t\t\t\tclass=\"radio js-field-data\" \t\t\t\t\t\tname=\"variant[]\" \t\t\t\t\t\tvalue=\"72947\" \/> \t\t\t\t<\/td>\n<td class=\"label\"> \t\t\t\t\t<label for=\"vv72947\">\u0414\u0430<\/label> \t\t\t\t<\/td>\n<\/tr>\n<tr>\n<td class=\"input\"> \t\t\t\t\t<input type=\"radio\" id=\"vv72949\" \t\t\t\t\t\tclass=\"radio js-field-data\" \t\t\t\t\t\tname=\"variant[]\" \t\t\t\t\t\tvalue=\"72949\" \/> \t\t\t\t<\/td>\n<td class=\"label\"> \t\t\t\t\t<label for=\"vv72949\">\u041d\u0435\u0442<\/label> \t\t\t\t<\/td>\n<\/tr>\n<\/table>\n<p class=\"total\">\u041d\u0438\u043a\u0442\u043e \u0435\u0449\u0451 \u043d\u0435 \u0433\u043e\u043b\u043e\u0441\u043e\u0432\u0430\u043b. \u0412\u043e\u0437\u0434\u0435\u0440\u0436\u0430\u0432\u0448\u0438\u0445\u0441\u044f \u043d\u0435\u0442.<\/p>\n<\/p><\/form>\n<p class=\"for_users_only_msg\">\u0422\u043e\u043b\u044c\u043a\u043e \u0437\u0430\u0440\u0435\u0433\u0438\u0441\u0442\u0440\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0435 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u0438 \u043c\u043e\u0433\u0443\u0442 \u0443\u0447\u0430\u0441\u0442\u0432\u043e\u0432\u0430\u0442\u044c \u0432 \u043e\u043f\u0440\u043e\u0441\u0435. <a href=\"https:\/\/habrahabr.ru\/auth\/login\/\">\u0412\u043e\u0439\u0434\u0438\u0442\u0435<\/a>, \u043f\u043e\u0436\u0430\u043b\u0443\u0439\u0441\u0442\u0430.<\/p>\n<\/p><\/div>\n<div class=\"clear\"><\/div>\n<p> \u0441\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b \u0441\u0442\u0430\u0442\u044c\u0438 <a href=\"https:\/\/habrahabr.ru\/post\/282369\/\"> https:\/\/habrahabr.ru\/post\/282369\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"\n<p>\u0412\u0441\u0435\u043c \u0434\u043e\u0431\u0440\u044b\u0439 \u0434\u0435\u043d\u044c. \u041d\u0435\u043c\u043d\u043e\u0433\u043e \u0441 \u0437\u0430\u0434\u0435\u0440\u0436\u043a\u043e\u0439, \u043d\u043e \u0432\u0441\u0435 \u0436\u0435 \u0432\u044b\u0445\u043e\u0434\u0438\u0442 <a href=\"https:\/\/www.gitbook.com\/book\/maxfarseer\/react-router-course-ru\/details\">\u0442\u0440\u0435\u0442\u0438\u0439 \u043c\u0438\u043d\u0438-\u0443\u0447\u0435\u0431\u043d\u0438\u043a<\/a>. \u041d\u0430 \u044d\u0442\u043e\u0442 \u0440\u0430\u0437 \u0440\u0430\u0437\u043e\u0431\u0440\u0430\u043d <a href=\"https:\/\/github.com\/reactjs\/react-router\">react-router<\/a>. \u0410 \u0442\u0430\u043a \u0436\u0435 \u0434\u0432\u0435 \u0433\u043b\u0430\u0432\u044b \u043f\u043e\u0441\u0432\u0435\u0449\u0435\u043d\u044b \u0438\u043d\u0442\u0435\u0433\u0440\u0430\u0446\u0438\u0438 react-router + <a href=\"http:\/\/redux.js.org\/\">redux<\/a>.<\/p>\n<p>  <\/p>\n<p>\u0412 \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u0435 \u0438\u043d\u0442\u0435\u0433\u0440\u0430\u0446\u0438\u0438 rr+redux \u044f <strong>\u043d\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043b<\/strong> <a href=\"https:\/\/github.com\/reactjs\/react-router-redux\">react-router-redux<\/a> \u0438 <a href=\"https:\/\/github.com\/acdlite\/redux-router\">redux-router<\/a>. \u041a\u0430\u043a \u0443\u043a\u0430\u0437\u0430\u043d\u043e \u0432 \u0441\u0430\u043c\u043e\u0439 \u043a\u043d\u0438\u0433\u0435, \u0438\u0437-\u0437\u0430 \u0430\u043a\u0442\u0438\u0432\u043d\u043e\u0433\u043e \u0440\u0430\u0437\u0432\u0438\u0442\u0438\u044f \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a, \u043c\u043d\u0435 \u0445\u043e\u0442\u0435\u043b\u043e\u0441\u044c \u0431\u044b \u00ab\u043d\u0430\u0443\u0447\u0438\u0442\u044c \u0432\u0430\u0441 \u0440\u044b\u0431\u0430\u0447\u0438\u0442\u044c\u00bb, \u0430 \u043d\u0435 \u043f\u0440\u043e\u0441\u0442\u043e \u00ab\u0434\u0430\u0442\u044c \u0440\u044b\u0431\u0443\u00bb.<\/p>\n<p>  <\/p>\n<p>\u0422\u0430\u043a\u0436\u0435, \u043f\u0440\u0438\u0432\u0435\u0434\u0435\u043d\u043d\u044b\u0439 \u0441\u043f\u043e\u0441\u043e\u0431 \u043f\u043e \u0438\u043d\u0442\u0435\u0433\u0440\u0430\u0446\u0438\u0438 \u043e\u0441\u043d\u043e\u0432\u0430\u043d \u043d\u0430 \u043b\u0438\u0447\u043d\u043e\u043c \u043e\u043f\u044b\u0442\u0435, \u043f\u043b\u044e\u0441 \u043e\u0442\u0432\u0435\u0442\u0430\u0445 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u0430 redux (<a href=\"https:\/\/twitter.com\/dan_abramov\">\u0435\u0433\u043e \u0442\u0432\u0438\u0442\u0442\u0435\u0440<\/a>) \u043d\u0430 SO, \u0438 \u0438\u0437\u0443\u0447\u0435\u043d\u0438\u0438 \u0440\u0430\u0437\u043b\u0438\u0447\u043d\u044b\u0445 \u0440\u0435\u043f\u043e\u0437\u0438\u0442\u043e\u0440\u0438\u0435\u0432. \u041e\u043d \u043d\u0435 \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u00ab\u0435\u0434\u0438\u043d\u0441\u0442\u0432\u0435\u043d\u043d\u043e \u0432\u0435\u0440\u043d\u044b\u043c\u00bb. \u041f\u043e\u0436\u0430\u043b\u0443\u0439\u0441\u0442\u0430, \u0443\u043a\u0430\u0436\u0438\u0442\u0435 \u0441\u0441\u044b\u043b\u043a\u0438 \u043d\u0430 \u0432\u0430\u0448\u0438 \u0440\u0435\u043f\u043e\u0437\u0438\u0442\u043e\u0440\u0438\u0438, \u043b\u0438\u0431\u043e \u043f\u0440\u0435\u0434\u043b\u043e\u0436\u0438\u0442\u0435 \u0441\u0432\u043e\u0438 \u0432\u0430\u0440\u0438\u0430\u043d\u0442\u044b \u0432 \u043a\u043e\u043c\u043c\u0435\u043d\u0442\u0430\u0440\u0438\u044f\u0445.<\/p>\n<p>  <\/p>\n<p>\u041f\u043e\u0435\u0445\u0430\u043b\u0438!<\/p>\n<p>  <\/p>\n<p><img decoding=\"async\" src=\"http:\/\/cs626129.vk.me\/v626129237\/5285\/mGCxPuP0btQ.jpg\" alt=\"book_screen\"\/><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[],"tags":[],"class_list":["post-278983","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/278983","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=278983"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/278983\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=278983"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=278983"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=278983"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}