{"id":287217,"date":"2017-06-01T17:20:05","date_gmt":"2017-06-01T13:20:05","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=287217"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=287217","title":{"rendered":"\u041f\u0440\u043e\u0441\u0442\u043e\u0439 \u0442\u0443\u0442\u043e\u0440\u0438\u0430\u043b React Router v4"},"content":{"rendered":"<p><img decoding=\"async\" src=\"http:\/\/booborguru.com\/wp-content\/uploads\/2017\/02\/complex-layouts.jpg\" alt=\"image\"\/><\/p>\n<p>  <a href=\"https:\/\/medium.com\/@pshrmn\">\u0410\u0432\u0442\u043e\u0440 @pshrmn<\/a> \u2b1d <a href=\"https:\/\/medium.com\/@pshrmn\/a-simple-react-router-v4-tutorial-7f23ff27adf\">\u041e\u0440\u0438\u0433\u0438\u043d\u0430\u043b\u044c\u043d\u0430\u044f \u0441\u0442\u0430\u0442\u044c\u044f<\/a> \u2b1d <u>\u0412\u0440\u0435\u043c\u044f \u0447\u0442\u0435\u043d\u0438\u044f<\/u>: <b>10 \u043c\u0438\u043d\u0443\u0442<\/b><\/p>\n<p>  <a href=\"https:\/\/reacttraining.com\/react-router\/\">React Router v4<\/a> \u2014 \u044d\u0442\u043e \u043f\u0435\u0440\u0435\u0440\u0430\u0431\u043e\u0442\u0430\u043d\u043d\u044b\u0439 \u0432\u0430\u0440\u0438\u0430\u043d\u0442 \u043f\u043e\u043f\u0443\u043b\u044f\u0440\u043d\u043e\u0433\u043e React \u0434\u043e\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f. \u0417\u0430\u0432\u0438\u0441\u0438\u043c\u044b\u0435 \u043e\u0442 \u043f\u043b\u0430\u0442\u0444\u043e\u0440\u043c\u044b \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u0438 \u0440\u043e\u0443\u0442\u043e\u0432 \u0438\u0437 \u043f\u0440\u043e\u0448\u043b\u043e\u0439 \u0432\u0435\u0440\u0441\u0438\u0438 \u0431\u044b\u043b\u0438 \u0443\u0434\u0430\u043b\u0435\u043d\u044b \u0438 \u0442\u0435\u043f\u0435\u0440\u044c \u0432\u0441\u0451 \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u043f\u0440\u043e\u0441\u0442\u044b\u043c\u0438 \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u0430\u043c\u0438. <br \/>  <a name=\"habracut\"><\/a><br \/>  \u042d\u0442\u043e\u0442 \u0442\u0443\u0442\u043e\u0440\u0438\u0430\u043b \u043f\u043e\u043a\u0440\u044b\u0432\u0430\u0435\u0442 \u0432\u0441\u0451 \u0447\u0442\u043e \u0432\u0430\u043c \u043d\u0443\u0436\u043d\u043e \u0434\u043b\u044f \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f \u0432\u0435\u0431-\u0441\u0430\u0439\u0442\u043e\u0432 \u0441 React Router. \u041c\u044b \u0431\u0443\u0434\u0435\u043c \u0441\u043e\u0437\u0434\u0430\u0432\u0430\u0442\u044c \u0441\u0430\u0439\u0442 \u0434\u043b\u044f \u043b\u043e\u043a\u0430\u043b\u044c\u043d\u043e\u0439 \u0441\u043f\u043e\u0440\u0442\u0438\u0432\u043d\u043e\u0439 \u043a\u043e\u043c\u0430\u043d\u0434\u044b.<\/p>\n<p>  \u0425\u043e\u0447\u0435\u0448\u044c \u043f\u043e\u0441\u043c\u043e\u0442\u0440\u0435\u0442\u044c \u0434\u0435\u043c\u043a\u0443?<\/p>\n<div class=\"oembed\">\n<div>\n<div style=\"left: 0; width: 100%; height: 300px; position: relative;\"><iframe src=\"https:\/\/codepen.io\/pshrmn\/embed\/preview\/YZXZqM?height=300&amp;slug-hash=YZXZqM&amp;default-tabs=js,result&amp;host=https:\/\/codepen.io&amp;embed-version=2\" style=\"border: 0; top: 0; left: 0; width: 100%; height: 100%; position: absolute;\" allowfullscreen><\/iframe><\/div>\n<\/div>\n<\/div>\n<h2><b>\u0423\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0430<\/b><\/h2>\n<p>  React Router v4 \u0431\u044b\u043b \u0440\u0430\u0437\u0431\u0438\u0442 \u043d\u0430 3 \u043f\u0430\u043a\u0435\u0442\u0430:<\/p>\n<pre><code class=\"javascript\">react-router<\/code><\/pre>\n<p>  <\/p>\n<pre><code class=\"javascript\">router-dom<\/code><\/pre>\n<p>  <\/p>\n<pre><code class=\"javascript\">react-router-native<\/code><\/pre>\n<p>  <code>react-router<\/code> \u043f\u0440\u0435\u0434\u043e\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u0442 \u0431\u0430\u0437\u043e\u0432\u044b\u0435 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u0438 \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u044b \u0434\u043b\u044f \u0440\u0430\u0431\u043e\u0442\u044b \u0432 \u0434\u0432\u0443\u0445 \u043e\u043a\u0440\u0443\u0436\u0435\u043d\u0438\u044f\u0445(\u0411\u0440\u0430\u0443\u0437\u0435\u0440\u0435 \u0438 react-native)<\/p>\n<p>  \u041c\u044b \u0431\u0443\u0434\u0435\u043c \u0441\u043e\u0437\u0434\u0430\u0432\u0430\u0442\u044c \u0441\u0430\u0439\u0442 \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0431\u0443\u0434\u0435\u0442 \u043e\u0442\u043e\u0431\u0440\u0430\u0436\u0430\u0442\u044c\u0441\u044f \u0432 \u0431\u0440\u0430\u0443\u0437\u0435\u0440\u0435, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u043d\u0430\u043c \u0441\u043b\u0435\u0434\u0443\u0435\u0442 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c <code>react-router-dom<\/code>. <code>react-router-dom<\/code> \u044d\u043a\u0441\u043f\u043e\u0440\u0442\u0438\u0440\u0443\u0435\u0442 \u0438\u0437 <code>react-router<\/code> \u0432\u0441\u0435 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u043d\u0430\u043c \u043d\u0443\u0436\u043d\u043e \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u044c \u0442\u043e\u043b\u044c\u043a\u043e <code>react-router-dom<\/code>.<\/p>\n<pre><code class=\"javascript\">npm install --save react-router-dom<\/code><\/pre>\n<p>  <\/p>\n<h2><b>Router<\/b><\/h2>\n<p>  \u041f\u0440\u0438 \u0441\u0442\u0430\u0440\u0442\u0435 \u043f\u0440\u043e\u0435\u043a\u0442\u0430 \u0432\u0430\u043c \u043d\u0443\u0436\u043d\u043e \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0438\u0442\u044c \u043a\u0430\u043a\u043e\u0439 \u0442\u0438\u043f \u0440\u043e\u0443\u0442\u0435\u0440\u0430 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c. \u0414\u043b\u044f \u0431\u0440\u0430\u0443\u0437\u0435\u0440\u043d\u044b\u0445 \u043f\u0440\u043e\u0435\u043a\u0442\u043e\u0432 \u0435\u0441\u0442\u044c <code>BrowserRouter<\/code> \u0438 <code>HashRouter<\/code> \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u044b. <code>BrowserRouter<\/code> \u2014 \u0441\u043b\u0435\u0434\u0443\u0435\u0442 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u043a\u043e\u0433\u0434\u0430 \u0432\u044b \u043e\u0431\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u0435\u0442\u0435 \u043d\u0430 \u0441\u0435\u0440\u0432\u0435\u0440\u0435 \u0434\u0438\u043d\u0430\u043c\u0438\u0447\u0435\u0441\u043a\u0438\u0435 \u0437\u0430\u043f\u0440\u043e\u0441\u044b, \u0430 <code>HashRouter<\/code> \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0439\u0442\u0435 \u043a\u043e\u0433\u0434\u0430 \u0443 \u0432\u0430\u0441 \u0441\u0442\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438\u0439 \u0432\u0435\u0431 \u0441\u0430\u0439\u0442.<\/p>\n<p>  \u041e\u0431\u044b\u0447\u043d\u043e \u043f\u0440\u0435\u0434\u043f\u043e\u0447\u0442\u0438\u0442\u0435\u043b\u044c\u043d\u0435\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c <code>BrowserRouter<\/code>, \u043d\u043e \u0435\u0441\u043b\u0438 \u0432\u0430\u0448 \u0441\u0430\u0439\u0442 \u0440\u0430\u0441\u043f\u043e\u043b\u043e\u0436\u0435\u043d \u043d\u0430 \u0441\u0442\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u043e\u043c \u0441\u0435\u0440\u0432\u0435\u0440\u0435(<i>\u043e\u0442 \u043f\u0435\u0440\u0435\u0432. \u043a\u0430\u043a github pages<\/i>), \u0442\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c <code>HashRouter<\/code> \u044d\u0442\u043e \u0445\u043e\u0440\u043e\u0448\u0435\u0435 \u0440\u0435\u0448\u0435\u043d\u0438\u0435 \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u044b.<br \/>  \u041d\u0430\u0448 \u043f\u0440\u043e\u0435\u043a\u0442 \u043f\u0440\u0435\u0434\u043f\u043e\u043b\u0430\u0433\u0430\u0435\u0442 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435 \u0431\u0435\u043a\u0435\u043d\u0434\u0430 \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u043c\u044b \u0431\u0443\u0434\u0435\u043c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c <code>BrowserRouter<\/code>.<\/p>\n<h3><b>\u0418\u0441\u0442\u043e\u0440\u0438\u044f \u2014 History<\/b><\/h3>\n<p>  \u041a\u0430\u0436\u0434\u044b\u0439 Router \u0441\u043e\u0437\u0434\u0430\u0435\u0442 \u043e\u0431\u044a\u0435\u043a\u0442 <code>history<\/code> \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0445\u0440\u0430\u043d\u0438\u0442 \u043f\u0443\u0442\u044c \u043a \u0442\u0435\u043a\u0443\u0449\u0435\u043c\u0443 location[1] \u0438 \u043f\u0435\u0440\u0435\u0440\u0438\u0441\u043e\u0432\u044b\u0432\u0430\u0435\u0442 \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441 \u0441\u0430\u0439\u0442\u0430 \u043a\u043e\u0433\u0434\u0430 \u043f\u0440\u043e\u0438\u0441\u0445\u043e\u0434\u044f\u0442 \u043a\u0430\u043a\u0438\u0435 \u0442\u043e \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u044f \u043f\u0443\u0442\u0438.<\/p>\n<p>  \u041e\u0441\u0442\u0430\u043b\u044c\u043d\u044b\u0435 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u043f\u0440\u0435\u0434\u043e\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u043c\u044b\u0435 \u0432 React Router \u043f\u043e\u043b\u0430\u0433\u0430\u044e\u0442\u0441\u044f \u043d\u0430 \u0434\u043e\u0441\u0442\u0443\u043f\u043d\u043e\u0441\u0442\u044c \u043e\u0431\u044a\u0435\u043a\u0442\u0430 <code>history<\/code> \u0447\u0435\u0440\u0435\u0437 context, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u043e\u043d\u0438 \u0434\u043e\u043b\u0436\u043d\u044b \u0440\u0435\u043d\u0434\u0435\u0440\u0438\u0442\u044c\u0441\u044f \u0432\u043d\u0443\u0442\u0440\u0438 \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u0430 Router.<\/p>\n<p>  <b>\u0417\u0430\u043c\u0435\u0442\u043a\u0430: <\/b>\u041a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u044b React Router \u043d\u0435 \u0438\u043c\u0435\u044e\u0449\u0438\u0435 \u0432 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 \u043f\u0440\u0435\u0434\u043a\u0430 \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442 Router \u043d\u0435 \u0431\u0443\u0434\u0443\u0442 \u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c, \u0442\u0430\u043a \u043a\u0430\u043a \u043d\u0435 \u0431\u0443\u0434\u0435\u0442 \u0434\u043e\u0441\u0442\u0443\u043f\u0435\u043d context.<\/p>\n<h3><b>\u0420\u0435\u043d\u0434\u0435\u0440\u0438\u043d\u0433 Router<\/b><\/h3>\n<p>  \u041a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442 Router \u043e\u0436\u0438\u0434\u0430\u0435\u0442 \u0442\u043e\u043b\u044c\u043a\u043e \u043e\u0434\u0438\u043d \u044d\u043b\u0435\u043c\u0435\u043d\u0442 \u0432 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 \u0434\u043e\u0447\u0435\u0440\u043d\u0435\u0433\u043e. \u0427\u0442\u043e \u0431\u044b \u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c \u0432 \u0440\u0430\u043c\u043a\u0430\u0445 \u044d\u0442\u043e\u0433\u043e \u0443\u0441\u043b\u043e\u0432\u0438\u044f, \u0443\u0434\u043e\u0431\u043d\u043e \u0441\u043e\u0437\u0434\u0430\u0442\u044c \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442 &lt;App\/&gt; \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0440\u0435\u043d\u0434\u0435\u0440\u0438\u0442\u044c \u0432\u0441\u0451 \u0432\u0430\u0448\u0435 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435(\u044d\u0442\u043e \u0442\u0430\u043a \u0436\u0435 \u0432\u0430\u0436\u043d\u043e \u0434\u043b\u044f \u0441\u0435\u0440\u0432\u0435\u0440\u043d\u043e\u0433\u043e \u0440\u0435\u043d\u0434\u0435\u0440\u0438\u043d\u0433\u0430).<\/p>\n<pre><code class=\"javascript\">import { BrowserRouter } from 'react-router-dom';  ReactDOM.render((   &lt;BrowserRouter&gt;     &lt;App \/&gt;   &lt;\/BrowserRouter&gt; ), document.getElementById('root')) <\/code><\/pre>\n<p>  <\/p>\n<h2><b>App \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442<\/b><\/h2>\n<p>  \u041d\u0430\u0448\u0435 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u043d\u0430\u0447\u0438\u043d\u0430\u0435\u0442\u0441\u044f \u0441 <code>&lt;App\/&gt;<\/code> \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u0430 \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043c\u044b \u0440\u0430\u0437\u0434\u0435\u043b\u0438\u043c \u043d\u0430 \u0434\u0432\u0435 \u0447\u0430\u0441\u0442\u0438. <code>&lt;Header\/&gt;<\/code> \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0431\u0443\u0434\u0435\u0442 \u0441\u043e\u0434\u0435\u0440\u0436\u0430\u0442\u044c \u043d\u0430\u0432\u0438\u0433\u0430\u0446\u0438\u043e\u043d\u043d\u044b\u0435 \u0441\u0441\u044b\u043b\u043a\u0438 \u0438 <code>&lt;Main\/&gt;<\/code> \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0431\u0443\u0434\u0435\u0442 \u0441\u043e\u0434\u0435\u0440\u0436\u0430\u0442\u044c \u043a\u043e\u043d\u0442\u0435\u043d\u0442 \u0440\u043e\u0443\u0442\u043e\u0432.<\/p>\n<pre><code class=\"javascript\">\/\/ \u042d\u0442\u043e\u0442 \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442 \u0431\u0443\u0434\u0435\u0442 \u043e\u0442\u0440\u0435\u043d\u0434\u0435\u0440\u0435\u043d \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u043d\u0430\u0448\u0435\u0433\u043e &lt;Router&gt; const App = () =&gt; (   &lt;div&gt;     &lt;Header \/&gt;     &lt;Main \/&gt;   &lt;\/div&gt; ) <\/code><\/pre>\n<p>  <\/p>\n<h2><b>Routes<\/b><\/h2>\n<p>  <code>&lt;Route\/&gt;<\/code> \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442 \u044d\u0442\u043e \u0433\u043b\u0430\u0432\u043d\u044b\u0439 \u0441\u0442\u0440\u043e\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u0439 \u0431\u043b\u043e\u043a React Router&#8217;\u0430. \u0412 \u0442\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u0435\u0441\u043b\u0438 \u0432\u0430\u043c \u043d\u0443\u0436\u043d\u043e \u0440\u0435\u043d\u0434\u0435\u0440\u0438\u0442\u044c \u044d\u043b\u0435\u043c\u0435\u043d\u0442 \u0432 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0438 \u043e\u0442 pathname URL&#8217;\u043e\u0432, \u0442\u043e \u0441\u043b\u0435\u0434\u0443\u0435\u0442 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442 <code>&lt;Route\/&gt;<\/code><\/p>\n<h3><b>Path \u2014 \u043f\u0443\u0442\u044c<\/b><\/h3>\n<p>  <code>&lt;Route \/&gt;<\/code> \u043f\u0440\u0438\u043d\u0438\u043c\u0430\u0435\u0442 <code>path<\/code> \u0432 \u0432\u0438\u0434\u0435 prop \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043e\u043f\u0438\u0441\u044b\u0432\u0430\u0435\u0442 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u043d\u044b\u0439 \u043f\u0443\u0442\u044c \u0438 \u0441\u043e\u043f\u043e\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0441 location.pathname.\u200a<\/p>\n<pre><code class=\"javascript\">&lt;Route path='\/roster'\/&gt;<\/code><\/pre>\n<p>  \u0412 \u043f\u0440\u0438\u043c\u0435\u0440\u0435 \u0432\u044b\u0448\u0435 <code>&lt;Route\/&gt;<\/code> \u0441\u043e\u043f\u043e\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u0442 location.pathname \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043d\u0430\u0447\u0438\u043d\u0430\u0435\u0442\u0441\u044f \u0441 \/roster[2]. \u041a\u043e\u0433\u0434\u0430 \u0442\u0435\u043a\u0443\u0449\u0438\u0439 location.pathname \u0441\u043e\u043f\u043e\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u043f\u043e\u043b\u043e\u0436\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u0441 prop path \u0442\u043e \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442 \u0431\u0443\u0434\u0435\u0442 \u043e\u0442\u0440\u0435\u043d\u0434\u0435\u0440\u0435\u043d, \u0430 \u0435\u0441\u043b\u0438 \u043c\u044b \u043d\u0435 \u043c\u043e\u0436\u0435\u043c \u0438\u0445 \u0441\u043e\u043f\u043e\u0441\u0442\u0430\u0432\u0438\u0442\u044c, \u0442\u043e Route \u043d\u0438\u0447\u0435\u0433\u043e \u043d\u0435 \u0440\u0435\u043d\u0434\u0435\u0440\u0438\u0442[3].<\/p>\n<pre><code class=\"javascript\"> &lt;Route path='\/roster'\/&gt; \/\/ \u041a\u043e\u0433\u0434\u0430 location.pathname \u044d\u0442\u043e '\/', prop path \u043d\u0435 \u0441\u043e\u0432\u043f\u0430\u0434\u0430\u0435\u0442 \/\/ \u041a\u043e\u0433\u0434\u0430 location.pathname \u044d\u0442\u043e '\/roster' \u0438\u043b\u0438 '\/roster\/2', prop path \u0441\u043e\u0432\u043f\u0430\u0434\u0430\u0435\u0442 \/\/ \u0415\u0441\u043b\u0438 \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043b\u0435\u043d exact prop. \u0421\u043e\u0432\u043f\u0430\u0434\u0430\u0435\u0442 \u0442\u043e\u043b\u044c\u043a\u043e \u0441\u0442\u0440\u043e\u0433\u043e\u0435 \u0441\u0440\u0430\u0432\u043d\u0435\u043d\u0438\u0435 '\/roster', \u043d\u043e \u043d\u0435 \/\/ '\/roster\/2' &lt;Route exact path='\/roster'\/&gt; <\/code><\/pre>\n<p>  <b>\u0417\u0430\u043c\u0435\u0442\u043a\u0430:<\/b> \u041a\u043e\u0433\u0434\u0430 \u0440\u0435\u0447\u044c \u0438\u0434\u0435\u0442 \u043e \u043f\u0443\u0442\u0438 React Router \u0434\u0443\u043c\u0430\u0435\u0442 \u0442\u043e\u043b\u044c\u043a\u043e \u043e \u043f\u0443\u0442\u0438 \u0431\u0435\u0437 \u0434\u043e\u043c\u0435\u043d\u0430. \u042d\u0442\u043e \u0437\u043d\u0430\u0447\u0438\u0442, \u0447\u0442\u043e \u0432 \u0430\u0434\u0440\u0435\u0441\u0435:<\/p>\n<pre><code>http:\/\/www.example.com\/my-projects\/one?extra=false<\/code><\/pre>\n<p>  React Router \u0431\u0443\u0434\u0435\u0442 \u0432\u0438\u0434\u0435\u0442\u044c \u0442\u043e\u043b\u044c\u043a\u043e <code>\/my-projects\/one<\/code><\/p>\n<h3><b>\u0421\u043e\u043f\u043e\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u0438\u0435 \u043f\u0443\u0442\u0438<\/b><\/h3>\n<p>  npm \u043f\u0430\u043a\u0435\u0442 <code>path-to-regexp<\/code> \u043a\u043e\u043c\u043f\u0438\u043b\u0438\u0440\u0443\u0435\u0442 prop path \u0432 \u0440\u0435\u0433\u0443\u043b\u044f\u0440\u043d\u043e\u0435 \u0432\u044b\u0440\u0430\u0436\u0435\u043d\u0438\u0435 \u0438 \u0441\u043e\u043f\u043e\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u0442 \u0435\u0433\u043e \u043f\u0440\u043e\u0442\u0438\u0432 location.pathname. \u0421\u0442\u0440\u043e\u043a\u0438 path \u0438\u043c\u0435\u044e\u0442 \u0431\u043e\u043b\u0435\u0435 \u0441\u043b\u043e\u0436\u043d\u044b\u0435 \u043e\u043f\u0446\u0438\u0438 \u0444\u043e\u0440\u043c\u0430\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u0447\u0435\u043c \u043e\u0431\u044a\u044f\u0441\u043d\u044f\u044e\u0442\u0441\u044f \u0437\u0434\u0435\u0441\u044c. \u0412\u044b \u043c\u043e\u0436\u0435\u0442\u0435 \u043f\u043e\u0447\u0438\u0442\u0430\u0442\u044c <a href=\"https:\/\/github.com\/pillarjs\/path-to-regexp\">\u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430\u0446\u0438\u044e<\/a>.<\/p>\n<p>  \u041a\u043e\u0433\u0434\u0430 \u043f\u0443\u0442\u0438 \u0441\u043e\u043f\u043e\u0441\u0442\u0430\u0432\u043b\u044f\u044e\u0442\u0441\u044f \u0441\u043e\u0437\u0434\u0430\u0435\u0442\u0441\u044f \u043e\u0431\u044a\u0435\u043a\u0442 <code>match<\/code> \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u0442 \u0441\u0432\u043e\u0439\u0441\u0442\u0432\u0430:<\/p>\n<ul>\n<li> <b>url<\/b> \u2014 \u0441\u043e\u043f\u043e\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u043c\u0430\u044f \u0447\u0430\u0441\u0442\u044c \u0442\u0435\u043a\u0443\u0449\u0435\u0433\u043e location.pathname <\/li>\n<li><b>path<\/b> \u2014 \u043f\u0443\u0442\u044c \u0432 \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u0435 Route<\/li>\n<li><b>isExact<\/b> \u2014 path \u0432 Route === location.pathname<\/li>\n<li><b>params<\/b> \u2014 \u043e\u0431\u044a\u0435\u043a\u0442 \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u0442 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f \u0438\u0437 path \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u0442 \u043c\u043e\u0434\u0443\u043b\u044c path-to-regexp<\/li>\n<\/ul>\n<p>  <b>\u0417\u0430\u043c\u0435\u0442\u043a\u0430:<\/b> \u041c\u043e\u0436\u0435\u0442\u0435 \u043f\u043e\u0438\u0433\u0440\u0430\u0442\u044c\u0441\u044f \u0441 <a href=\"https:\/\/pshrmn.github.io\/route-tester\/#\/\">\u0442\u0435\u0441\u0442\u0435\u0440\u043e\u043c \u0440\u043e\u0443\u0442\u043e\u0432<\/a> \u0438 \u043f\u043e\u0441\u043c\u043e\u0442\u0440\u0435\u0442\u044c \u043a\u0430\u043a \u0441\u043e\u0437\u0434\u0430\u0435\u0442\u0441\u044f \u043e\u0431\u044a\u0435\u043a\u0442 match.<\/p>\n<p>  <b>\u0417\u0430\u043c\u0435\u0442\u043a\u0430:<\/b> path \u0432 Route \u0434\u043e\u043b\u0436\u0435\u043d \u0431\u044b\u0442\u044c \u0430\u0431\u0441\u043e\u043b\u044e\u0442\u043d\u044b\u043c[4].<\/p>\n<h3><b>\u0421\u043e\u0437\u0434\u0430\u043d\u0438\u0435 \u043d\u0430\u0448\u0438\u0445 \u0440\u043e\u0443\u0442\u043e\u0432<\/b><\/h3>\n<p>  \u041a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442 <code>Route<\/code> \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c \u0432 \u043b\u044e\u0431\u043e\u043c \u043c\u0435\u0441\u0442\u0435 \u0432 \u0440\u043e\u0443\u0442\u0435\u0440\u0435, \u043d\u043e \u0438\u043d\u043e\u0433\u0434\u0430 \u043d\u0443\u0436\u043d\u043e \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u044f\u0442\u044c, \u0447\u0442\u043e \u0440\u0435\u043d\u0434\u0435\u0440\u0438\u0442\u044c \u0432 \u043e\u0434\u043d\u043e \u0438 \u0442\u043e\u0436\u0435 \u043c\u0435\u0441\u0442\u043e. \u0412 \u0442\u0430\u043a\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u0441\u043b\u0435\u0434\u0443\u0435\u0442 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442 \u0433\u0440\u0443\u043f\u043f\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f Route&#8217;\u043e\u0432 \u2014 <code>&lt;Switch\/&gt;<\/code>. <code>&lt;Switch\/&gt;<\/code> \u0438\u0442\u0435\u0440\u0430\u0442\u0438\u0432\u043d\u043e \u043f\u0440\u043e\u0445\u043e\u0434\u0438\u0442 \u043f\u043e \u0434\u043e\u0447\u0435\u0440\u043d\u0438\u043c \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u0430\u043c \u0438 \u0440\u0435\u043d\u0434\u0435\u0440\u0438\u0442 \u0442\u043e\u043b\u044c\u043a\u043e \u043f\u0435\u0440\u0432\u044b\u0439 \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043f\u043e\u0434\u0445\u043e\u0434\u0438\u0442 \u043f\u043e\u0434 location.pathname.<\/p>\n<p>  \u0423 \u043d\u0430\u0448\u0435\u0433\u043e \u0432\u0435\u0431-\u0441\u0430\u0439\u0442\u0430 \u043f\u0443\u0442\u0438 \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043c\u044b \u0445\u043e\u0442\u0438\u043c \u0441\u043e\u043f\u043e\u0441\u0442\u0430\u0432\u043b\u044f\u0442\u044c \u0442\u0430\u043a\u0438\u0435:<\/p>\n<ul>\n<li><b>\/<\/b> \u2014 \u0413\u043b\u0430\u0432\u043d\u0430\u044f \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u0430<\/li>\n<li><b>\/roster<\/b> \u2014 \u0421\u0442\u0440\u0430\u043d\u0438\u0446\u0430 \u043a\u043e\u043c\u0430\u043d\u0434<\/li>\n<li><b>\/roster\/:number<\/b> \u2014 \u0421\u0442\u0440\u0430\u043d\u0438\u0446\u0430 \u043f\u0440\u043e\u0444\u0438\u043b\u044f \u0438\u0433\u0440\u043e\u043a\u0430 \u043f\u043e \u043d\u043e\u043c\u0435\u0440\u0443<\/li>\n<li><b>\/schedule<\/b> \u2014 \u0420\u0430\u0441\u043f\u0438\u0441\u0430\u043d\u0438\u0435 \u0438\u0433\u0440 \u043a\u043e\u043c\u0430\u043d\u0434\u044b<\/li>\n<\/ul>\n<p>  \u041f\u043e \u043f\u043e\u0440\u044f\u0434\u043a\u0443 \u0441\u043e\u043f\u043e\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u0438\u044f \u043f\u0443\u0442\u0435\u0439 \u0432 \u043d\u0430\u0448\u0435\u043c \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0438, \u0432\u0441\u0435 \u0447\u0442\u043e \u043d\u0430\u043c \u043d\u0443\u0436\u043d\u043e \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u044d\u0442\u043e \u0441\u043e\u0437\u0434\u0430\u0442\u044c \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442 Route \u0441 prop path \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043c\u044b \u0445\u043e\u0442\u0438\u043c \u0441\u043e\u043f\u043e\u0441\u0442\u0430\u0432\u0438\u0442\u044c.<\/p>\n<pre><code class=\"javascript\">&lt;Switch&gt;   &lt;Route exact path='\/' component={Home}\/&gt;   {\/* \u041e\u0431\u0430 \/roster \u0438 \/roster\/:number \u043d\u0430\u0447\u0438\u043d\u0430\u044e\u0442\u0441\u044f \u0441 \/roster *\/}   &lt;Route path='\/roster' component={Roster}\/&gt;   &lt;Route path='\/schedule' component={Schedule}\/&gt; &lt;\/Switch&gt; <\/code><\/pre>\n<p>  <\/p>\n<h3><b>\u0427\u0442\u043e \u0434\u0435\u043b\u0430\u0435\u0442 \u0440\u0435\u043d\u0434\u0435\u0440 \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u0430 Route?<\/b><\/h3>\n<p>  \u0423 Route \u0435\u0441\u0442\u044c 3 props&#8217;a \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043e\u043f\u0438\u0441\u044b\u0432\u0430\u044e\u0442 \u043a\u0430\u043a\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c \u0432\u044b\u043f\u043e\u043b\u043d\u0438\u0442\u044c \u0440\u0435\u043d\u0434\u0435\u0440 \u0441\u043e\u043f\u043e\u0441\u0442\u0430\u0432\u043b\u044f\u044f prop path \u0441 location.pathname \u0438 \u0442\u043e\u043b\u044c\u043a\u043e \u043e\u0434\u0438\u043d \u0438\u0437 prop \u0434\u043e\u043b\u0436\u0435\u043d \u0431\u044b\u0442\u044c \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u0435\u043d \u0432 Route:<\/p>\n<ul>\n<li><b>component<\/b> \u2014 React \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442. \u041a\u043e\u0433\u0434\u0430 \u0440\u043e\u0443\u0442 \u0443\u0434\u043e\u0432\u043b\u0435\u0442\u0432\u043e\u0440\u044f\u0435\u0442\u0441\u044f \u0441\u043e\u043f\u043e\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u0438\u0435 \u0432 path, \u0442\u043e \u043e\u043d \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u0442 \u043f\u0435\u0440\u0435\u0434\u0430\u043d\u043d\u044b\u0439 component (\u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044f \u0444\u0443\u043d\u043a\u0446\u0438\u044e React.createElement).<\/li>\n<li><b>render<\/b> \u2014 \u0444\u0443\u043d\u043a\u0446\u0438\u044f \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u0434\u043e\u043b\u0436\u043d\u0430 \u0432\u0435\u0440\u043d\u0443\u0442\u044c \u044d\u043b\u0435\u043c\u0435\u043d\u0442 React. \u0411\u0443\u0434\u0435\u0442 \u0432\u044b\u0437\u0432\u0430\u043d\u0430 \u043a\u043e\u0433\u0434\u0430 \u0443\u0434\u043e\u0432\u043b\u0435\u0442\u0432\u043e\u0440\u0438\u0442\u0441\u044f \u0441\u043e\u043f\u043e\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u0438\u0435 \u0432 path. Render \u0434\u043e\u0432\u043e\u043b\u044c\u043d\u043e \u043f\u043e\u0445\u043e\u0436 \u043d\u0430 component, \u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u0434\u043b\u044f inline \u0440\u0435\u043d\u0434\u0435\u0440\u0438\u043d\u0433\u0430 \u0438 \u043f\u043e\u0434\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0438 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u044b\u0445 \u0434\u043b\u044f \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u0430 props[5].<\/li>\n<li><b>children<\/b> \u2014 \u0432 \u043e\u0442\u043b\u0438\u0447\u0438\u0435 \u043e\u0442 \u043f\u0440\u0435\u0434\u044b\u0434\u0443\u0449\u0438\u0445 \u0434\u0432\u0443\u0445 props children \u0431\u0443\u0434\u0435\u0442 \u0432\u0441\u0435\u0433\u0434\u0430 \u043e\u0442\u043e\u0431\u0440\u0430\u0436\u0430\u0442\u044c\u0441\u044f \u043d\u0435\u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e \u043e\u0442 \u0442\u043e\u0433\u043e \u0441\u043e\u043f\u043e\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u043b\u0438 path \u0438\u043b\u0438 \u043d\u0435\u0442.<\/li>\n<\/ul>\n<p>  <\/p>\n<pre><code class=\"javascript\">&lt;Route path='\/page' component={Page} \/&gt; const extraProps = { color: 'red' } &lt;Route path='\/page' render={(props) =&gt; (   &lt;Page {...props} data={extraProps}\/&gt; )}\/&gt; &lt;Route path='\/page' children={(props) =&gt; (   props.match     ? &lt;Page {...props}\/&gt;     : &lt;EmptyPage {...props}\/&gt; )}\/&gt; <\/code><\/pre>\n<p>  \u0412 \u0442\u0438\u043f\u0438\u0447\u043d\u044b\u0445 \u0441\u0438\u0442\u0443\u0430\u0446\u0438\u044f\u0445 \u0441\u043b\u0435\u0434\u0443\u0435\u0442 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c component \u0438\u043b\u0438 render. Children prop \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d, \u043d\u043e \u043b\u0443\u0447\u0448\u0435 \u043d\u0438\u0447\u0435\u0433\u043e \u043d\u0435 \u0434\u0435\u043b\u0430\u0442\u044c \u0435\u0441\u043b\u0438 path \u043d\u0435 \u0441\u043e\u0432\u043f\u0430\u0434\u0430\u0435\u0442 \u0441 location.pathname.<\/p>\n<p>  \u042d\u043b\u0435\u043c\u0435\u043d\u0442\u0443 \u043e\u0442\u0440\u0435\u043d\u0434\u0435\u0440\u0435\u043d\u043d\u043e\u043c\u0443 <code>Route <\/code>\u0431\u0443\u0434\u0435\u0442 \u043f\u0435\u0440\u0435\u0434\u0430\u043d\u043e \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e props. <code>match <\/code> \u2014 \u043e\u0431\u044a\u0435\u043a\u0442 \u0441\u043e\u043f\u043e\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u0438\u044f <code>path <\/code> \u0441 <code>location.pathname<\/code>, <code>location<\/code> \u043e\u0431\u044a\u0435\u043a\u0442[6] \u0438 <code>history <\/code> \u043e\u0431\u044a\u0435\u043a\u0442(\u0441\u043e\u0437\u0434\u0430\u043d\u043d\u044b\u0439 \u0430\u0438\u043c \u0440\u043e\u0443\u0442\u043e\u043c)[7].<\/p>\n<h2><b>Main<\/b><\/h2>\n<p>  \u0421\u0435\u0439\u0447\u0430\u0441 \u043c\u044b \u043e\u043f\u0438\u0448\u0435\u043c \u043e\u0441\u043d\u043e\u0432\u043d\u0443\u044e \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0443 \u0440\u043e\u0443\u0442\u0435\u0440\u0430. \u041d\u0430\u043c \u043f\u0440\u043e\u0441\u0442\u043e \u043d\u0443\u0436\u043d\u043e \u043e\u0442\u043e\u0431\u0440\u0430\u0437\u0438\u0442\u044c \u043d\u0430\u0448\u0438 \u043c\u0430\u0440\u0448\u0440\u0443\u0442\u044b. \u0414\u043b\u044f \u043d\u0430\u0448\u0435\u0433\u043e \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u043c\u044b \u0431\u0443\u0434\u0435\u043c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442 <code>&lt;Switch\/&gt;<\/code> \u0438 \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442 <code>&lt;Route\/&gt;<\/code> \u0432\u043d\u0443\u0442\u0440\u0438 \u043d\u0430\u0448\u0435\u0433\u043e \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u0430 <code>&lt;Main\/&gt;<\/code> \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043f\u043e\u043c\u0435\u0441\u0442\u0438\u0442 \u0441\u0433\u0435\u043d\u0435\u0440\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0439 HTML \u0443\u0434\u043e\u0432\u043b\u0435\u0442\u0432\u043e\u0440\u044f\u044e\u0449\u0438\u0439 \u0441\u043e\u043f\u043e\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u0438\u044e <code>path <\/code>\u0432\u043d\u0443\u0442\u0440\u0438. <\/p>\n<p>  <code>&lt;Main\/&gt;<\/code> DOM \u0443\u0437\u043b\u0430(node)  <\/p>\n<pre><code class=\"javascript\">import { Switch, Route } from 'react-router-dom' const Main = () =&gt; (   &lt;main&gt;     &lt;Switch&gt;       &lt;Route exact path='\/' component={Home}\/&gt;       &lt;Route path='\/roster' component={Roster}\/&gt;       &lt;Route path='\/schedule' component={Schedule}\/&gt;     &lt;\/Switch&gt;   &lt;\/main&gt; ) <\/code><\/pre>\n<p>  <b>\u0417\u0430\u043c\u0435\u0442\u043a\u0430: <\/b> <code>Route <\/code>\u0434\u043b\u044f \u0433\u043b\u0430\u0432\u043d\u043e\u0439 \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u044b \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u0442 prop <code>exact<\/code>, \u0431\u043b\u0430\u0433\u043e\u0434\u0430\u0440\u044f \u043a\u043e\u0442\u043e\u0440\u043e\u043c\u0443 \u043f\u0443\u0442\u0438 \u0441\u0440\u0430\u0432\u043d\u0438\u0432\u0430\u044e\u0442\u0441\u044f \u0441\u0442\u0440\u043e\u0433\u043e.<\/p>\n<h3><b>\u0423\u043d\u0430\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u043d\u043d\u044b\u0435 \u0440\u043e\u0443\u0442\u044b<\/b><\/h3>\n<p>  \u041f\u0440\u043e\u0444\u0438\u043b\u044c \u0438\u0433\u0440\u043e\u043a\u0430 <code>\/roster\/:number<\/code> \u043d\u0435 \u0432\u043a\u043b\u044e\u0447\u0435\u043d \u0432 <code>&lt;Switch\/&gt;<\/code>. \u0412\u043c\u0435\u0441\u0442\u043e \u044d\u0442\u043e\u0433\u043e \u043e\u043d \u0431\u0443\u0434\u0435\u0442 \u0440\u0435\u043d\u0434\u0435\u0440\u0438\u0442\u044c\u0441\u044f \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u043e\u043c <code>&lt;Roster\/&gt;<\/code> \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0440\u0435\u043d\u0434\u0435\u0440\u0438\u0442\u044c\u0441\u044f \u0432\u0441\u044f\u043a\u0438\u0439 \u0440\u0430\u0437 \u043a\u043e\u0433\u0434\u0430 \u043f\u0443\u0442\u044c \u043d\u0430\u0447\u0438\u043d\u0430\u0435\u0442\u0441\u044f \u0441 <code>\/roster<\/code>.<\/p>\n<p>  \u0412 \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u0435 <code>Roster<\/code> \u043c\u044b \u0441\u043e\u0437\u0434\u0430\u0434\u0438\u043c \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u044b \u0434\u043b\u044f \u0434\u0432\u0443\u0445 \u043f\u0443\u0442\u0435\u0439:<\/p>\n<ul>\n<li><b>\/roster<\/b> \u2014 \u0441 prop exact <\/li>\n<li><b>\/roster\/:number<\/b> \u2014 \u044d\u0442\u043e\u0442 route \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440 \u043f\u0443\u0442\u0438, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0431\u0443\u0434\u0435\u0442 \u043e\u0442\u043b\u043e\u0432\u043b\u0435\u043d \u043f\u043e\u0441\u043b\u0435 \/roster<\/li>\n<\/ul>\n<p>  <\/p>\n<pre><code class=\"javascript\">const Roster = () =&gt; (   &lt;Switch&gt;     &lt;Route exact path='\/roster' component={FullRoster}\/&gt;     &lt;Route path='\/roster\/:number' component={Player}\/&gt;   &lt;\/Switch&gt; ) <\/code><\/pre>\n<p>  \u041c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c \u043f\u043e\u043b\u0435\u0437\u043d\u044b\u043c \u0433\u0440\u0443\u043f\u043f\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435 \u0440\u043e\u0443\u0442\u043e\u0432 \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0438\u043c\u0435\u044e\u0442 \u043e\u0431\u0449\u0438\u0435 \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u044b, \u0447\u0442\u043e \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u0443\u043f\u0440\u043e\u0441\u0442\u0438\u0442\u044c \u0440\u043e\u0434\u0438\u0442\u0435\u043b\u044c\u0441\u043a\u0438\u0435 \u043c\u0430\u0440\u0448\u0440\u0443\u0442\u044b \u0438 \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u043e\u0442\u043e\u0431\u0440\u0430\u0436\u0430\u0442\u044c \u043a\u043e\u043d\u0442\u0435\u043d\u0442 \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043e\u0442\u043d\u043e\u0441\u0438\u0442\u044c\u0441\u044f \u043a \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u0438\u043c \u0440\u043e\u0443\u0442\u0430\u043c.<\/p>\n<p>  \u041a \u043f\u0440\u0438\u043c\u0435\u0440\u0443 <code>&lt;Roster\/&gt;<\/code> \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c \u043e\u0442\u0440\u0435\u043d\u0434\u0435\u0440\u0435\u043d \u0441 \u0437\u0430\u0433\u043e\u043b\u043e\u0432\u043a\u043e\u043c \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0431\u0443\u0434\u0435\u0442 \u043e\u0442\u043e\u0431\u0440\u0430\u0436\u0430\u0442\u044c\u0441\u044f \u0432\u043e \u0432\u0441\u0435\u0445 \u0440\u043e\u0443\u0442\u0430\u0445 \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043d\u0430\u0447\u0438\u043d\u0430\u044e\u0442\u0441\u044f \u0441 <code>\/roster<\/code>.<\/p>\n<pre><code class=\"javascript\">const Roster = () =&gt; (   &lt;div&gt;     &lt;h2&gt;This is a roster page!&lt;\/h2&gt;     &lt;Switch&gt;       &lt;Route exact path='\/roster' component={FullRoster}\/&gt;       &lt;Route path='\/roster\/:number' component={Player}\/&gt;     &lt;\/Switch&gt;   &lt;\/div&gt; ) <\/code><\/pre>\n<p>  <\/p>\n<h3><b>\u041f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u044b \u0432 path<\/b><\/h3>\n<p>  \u0418\u043d\u043e\u0433\u0434\u0430 \u043d\u0430\u043c \u0442\u0440\u0435\u0431\u0443\u0435\u0442\u0441\u044f \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0435 \u0434\u043b\u044f \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u0438\u044f \u043a\u0430\u043a\u043e\u0439 \u043b\u0438\u0431\u043e \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u0438. \u041a \u043f\u0440\u0438\u043c\u0435\u0440\u0443, \u0440\u043e\u0443\u0442 \u043f\u0440\u043e\u0444\u0438\u043b\u044f \u0438\u0433\u0440\u043e\u043a\u0430, \u0433\u0434\u0435 \u043d\u0430\u043c \u0442\u0440\u0435\u0431\u0443\u0435\u0442\u0441\u044f \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u043d\u043e\u043c\u0435\u0440 \u0438\u0433\u0440\u043e\u043a\u0430. \u041c\u044b \u0441\u0434\u0435\u043b\u0430\u043b\u0438 \u044d\u0442\u043e \u0434\u043e\u0431\u0430\u0432\u0438\u0432 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440 \u0432 prop <code>path<\/code>.<\/p>\n<p>  <code>:number<\/code> \u0447\u0430\u0441\u0442\u044c \u0441\u0442\u0440\u043e\u043a\u0438 \u0432 <code>\/roster\/:number<\/code> \u043e\u0437\u043d\u0430\u0447\u0430\u0435\u0442, \u0447\u0442\u043e \u0447\u0430\u0441\u0442\u044c <code>path <\/code>\u043f\u043e\u0441\u043b\u0435 <code>\/roster\/<\/code> \u0431\u0443\u0434\u0435\u0442 \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u0430 \u0432 \u0432\u0438\u0434\u0435 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u043e\u0439 \u0438 \u0441\u043e\u0445\u0440\u0430\u043d\u0438\u0442\u044c\u0441\u044f \u0432 <code>match.params.number<\/code>. \u041a \u043f\u0440\u0438\u043c\u0435\u0440\u0443 \u043f\u0443\u0442\u044c <code>\/roster\/6<\/code> \u0441\u0433\u0435\u043d\u0435\u0440\u0438\u0440\u0443\u0435\u0442 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0439 \u043e\u0431\u044a\u0435\u043a\u0442 \u0441 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u0430\u043c\u0438:<\/p>\n<pre><code class=\"javascript\">{ number: '6' \/\/ \u041b\u044e\u0431\u043e\u0435 \u043f\u0435\u0440\u0435\u0434\u0430\u043d\u043d\u043e\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u0438\u043d\u0442\u0435\u0440\u043f\u0440\u0435\u0442\u0438\u0440\u0443\u0435\u0442\u0441\u044f \u043a\u0430\u043a \u0441\u0442\u0440\u043e\u043a\u0430}<\/code><\/pre>\n<p>  \u041a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442 <code>&lt;Player\/&gt;<\/code> \u0431\u0443\u0434\u0435\u0442 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c <code>props.match.params<\/code> \u0434\u043b\u044f \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u0438\u044f \u043d\u0443\u0436\u043d\u043e\u0439 \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u0438 \u043a\u043e\u0442\u043e\u0440\u0443\u044e \u0441\u043b\u0435\u0434\u0443\u0435\u0442 \u043e\u0442\u0440\u0435\u043d\u0434\u0435\u0440\u0438\u0442\u044c.<\/p>\n<pre><code class=\"javascript\">\/\/ API \u0432\u043e\u0437\u0440\u0430\u0449\u0430\u0435\u0442 \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044e \u043e\u0431 \u0438\u0433\u0440\u043e\u043a\u0435 \u0432 \u0432\u0438\u0434\u0435 \u043e\u0431\u044a\u0435\u043a\u0442\u0430 import PlayerAPI from '.\/PlayerAPI' const Player = (props) =&gt; {   const player = PlayerAPI.get(     parseInt(props.match.params.number, 10)   )   if (!player) {     return &lt;div&gt;Sorry, but the player was not found&lt;\/div&gt;   }   return (     &lt;div&gt;       &lt;h1&gt;{player.name} (#{player.number})&lt;\/h1&gt;       &lt;h2&gt;{player.position}&lt;\/h2&gt;     &lt;\/div&gt; ) <\/code><\/pre>\n<p>  <b>\u0417\u0430\u043c\u0435\u0442\u043a\u0430: <\/b> \u0412\u044b \u043c\u043e\u0436\u0435\u0442\u0435 \u0431\u043e\u043b\u044c\u0448\u0435 \u0438\u0437\u0443\u0447\u0438\u0442\u044c \u043e \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u0430\u0445 \u0432 \u043f\u0443\u0442\u044f\u0445 \u0432 \u043f\u0430\u043a\u0435\u0442\u0435 <a href=\"https:\/\/github.com\/pillarjs\/path-to-regexp#parameters\">path-to-regexp<\/a><\/p>\n<p>  \u041d\u0430\u0440\u044f\u0434\u0443 \u0441 \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u043e\u043c <code>&lt;Player\/&gt;<\/code> \u043d\u0430\u0448 \u0432\u0435\u0431-\u0441\u0430\u0439\u0442 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442 \u0438 \u0434\u0440\u0443\u0433\u0438\u0435 \u043a\u0430\u043a <code>&lt;FullRoster\/&gt;<\/code>, <code>&lt;Schedule\/&gt;<\/code> \u0438 <code>&lt;Home\/&gt;<\/code>.<\/p>\n<pre><code class=\"javascript\">const FullRoster = () =&gt; (   &lt;div&gt;     &lt;ul&gt;       {         PlayerAPI.all().map(p =&gt; (           &lt;li key={p.number}&gt;             &lt;Link to={`\/roster\/${p.number}`}&gt;{p.name}&lt;\/Link&gt;           &lt;\/li&gt;         ))       }     &lt;\/ul&gt;   &lt;\/div&gt; ) const Schedule = () =&gt; (   &lt;div&gt;     &lt;ul&gt;       &lt;li&gt;6\/5 @ \u0421\u043f\u0430\u0440\u0442\u0430\u043a&lt;\/li&gt;       &lt;li&gt;6\/8 vs \u0417\u0435\u043d\u0438\u0442&lt;\/li&gt;       &lt;li&gt;6\/14 @ \u0420\u0443\u0431\u0438\u043d&lt;\/li&gt;     &lt;\/ul&gt;   &lt;\/div&gt; ) const Home = () =&gt; (   &lt;div&gt;     &lt;h1&gt;\u0414\u043e\u0431\u0440\u043e \u043f\u043e\u0436\u0430\u043b\u043e\u0432\u0430\u0442\u044c \u043d\u0430 \u043d\u0430\u0448 \u0441\u0430\u0439\u0442!&lt;\/h1&gt;   &lt;\/div&gt; ) <\/code><\/pre>\n<p>  <\/p>\n<h2><b>\u0421\u0441\u044b\u043b\u043a\u0438<\/b><\/h2>\n<p>  \u041f\u043e\u0441\u043b\u0435\u0434\u043d\u0438\u0439 \u0448\u0442\u0440\u0438\u0445, \u043d\u0430\u0448 \u0441\u0430\u0439\u0442 \u043d\u0443\u0436\u0434\u0430\u0435\u0442\u0441\u044f \u0432 \u043d\u0430\u0432\u0438\u0433\u0430\u0446\u0438\u0438 \u043c\u0435\u0436\u0434\u0443 \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u0430\u043c\u0438. \u0415\u0441\u043b\u0438 \u043c\u044b \u0441\u043e\u0437\u0434\u0430\u0434\u0438\u043c \u043e\u0431\u044b\u0447\u043d\u044b\u0435 \u0441\u0441\u044b\u043b\u043a\u0438 \u0442\u043e \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u0430 \u0431\u0443\u0434\u0435\u0442 \u043f\u0435\u0440\u0435\u0437\u0430\u0433\u0440\u0443\u0436\u0430\u0442\u044c\u0441\u044f. React Router \u0440\u0435\u0448\u0430\u0435\u0442 \u044d\u0442\u0443 \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u0443 \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u043e\u043c <code>&lt;Link\/&gt;<\/code> \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043f\u0440\u0435\u0434\u043e\u0442\u0432\u0440\u0430\u0449\u0430\u0435\u0442 \u043f\u0435\u0440\u0435\u0437\u0430\u0433\u0440\u0443\u0437\u043a\u0443. \u041a\u043e\u0433\u0434\u0430 \u043c\u044b \u043a\u043b\u0438\u043a\u0430\u0435\u043c \u043d\u0430 <code>&lt;Link\/&gt;<\/code> \u043e\u043d \u043e\u0431\u043d\u043e\u0432\u043b\u044f\u0435\u0442 URL \u0438 React Router \u0440\u0435\u043d\u0434\u0435\u0440\u0438\u0442 \u043d\u0443\u0436\u043d\u044b\u0439 \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442 \u0431\u0435\u0437 \u043e\u0431\u043d\u043e\u0432\u043b\u0435\u043d\u0438\u044f \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u044b. <\/p>\n<pre><code class=\"javascript\">import { Link } from 'react-router-dom' const Header = () =&gt; (   &lt;header&gt;     &lt;nav&gt;       &lt;ul&gt;         &lt;li&gt;&lt;Link to='\/'&gt;Home&lt;\/Link&gt;&lt;\/li&gt;         &lt;li&gt;&lt;Link to='\/roster'&gt;Roster&lt;\/Link&gt;&lt;\/li&gt;         &lt;li&gt;&lt;Link to='\/schedule'&gt;Schedule&lt;\/Link&gt;&lt;\/li&gt;       &lt;\/ul&gt;     &lt;\/nav&gt;   &lt;\/header&gt; ) <\/code><\/pre>\n<p>  <code>&lt;Link\/&gt;<\/code> \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442 prop <code>to<\/code> \u0434\u043b\u044f \u043e\u043f\u0438\u0441\u0430\u043d\u0438\u044f URL \u043a\u0443\u0434\u0430 \u0441\u043b\u0435\u0434\u0443\u0435\u0442 \u043f\u0435\u0440\u0435\u0439\u0442\u0438. Prop to \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c \u0441\u0442\u0440\u043e\u043a\u043e\u0439 \u0438\u043b\u0438 location \u043e\u0431\u044a\u0435\u043a\u0442\u043e\u043c (\u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0441\u043e\u0441\u0442\u043e\u0438\u0442 \u0438\u0437 pathname, search, hash, state \u0441\u0432\u043e\u0439\u0441\u0442\u0432). \u0415\u0441\u043b\u0438 \u044d\u0442\u043e \u0441\u0442\u0440\u043e\u043a\u0430 \u0442\u043e \u043e\u043d\u0430 \u043a\u043e\u043d\u0432\u0435\u0440\u0442\u0438\u0440\u0443\u0435\u0442\u0441\u044f \u0432 location \u043e\u0431\u044a\u0435\u043a\u0442.<\/p>\n<pre><code class=\"javascript\">&lt;Link to={{ pathname: '\/roster\/7' }}&gt;Player #7&lt;\/Link&gt; <\/code><\/pre>\n<p>  <b>\u0417\u0430\u043c\u0435\u0442\u043a\u0430: <\/b> \u041f\u0443\u0442\u0438 \u0432 \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u0430\u0445 <code>&lt;Link\/&gt;<\/code> \u0434\u043e\u043b\u0436\u043d\u044b \u0431\u044b\u0442\u044c \u0430\u0431\u0441\u043e\u043b\u044e\u0442\u043d\u044b\u043c\u0438[4].<\/p>\n<h3><b>\u0420\u0430\u0431\u043e\u0442\u0430\u044e\u0449\u0438\u0439 \u043f\u0440\u0438\u043c\u0435\u0440<\/b><\/h3>\n<p>  \u0412\u0435\u0441\u044c \u043a\u043e\u0434 \u043d\u0430\u0448\u0435\u0433\u043e \u0432\u0435\u0431 \u0441\u0430\u0439\u0442\u0430 \u0434\u043e\u0441\u0442\u0443\u043f\u0435\u043d \u043f\u043e <a href=\"https:\/\/codepen.io\/pshrmn\/pen\/YZXZqM\">\u044d\u0442\u043e\u043c\u0443 \u0430\u0434\u0440\u0435\u0441\u0443<\/a> \u043d\u0430 codepen.<\/p>\n<h3><b>Route \u0433\u043e\u0442\u043e\u0432!<\/b><\/h3>\n<p>  \u041d\u0430\u0434\u0435\u044e\u0441\u044c \u0442\u0435\u043f\u0435\u0440\u044c \u0432\u044b \u0433\u043e\u0442\u043e\u0432\u044b \u043f\u043e\u0433\u0440\u0443\u0437\u0438\u0442\u044c\u0441\u044f \u0432 \u0438\u0437\u0443\u0447\u0435\u043d\u0438\u0435 \u0434\u0435\u0442\u0430\u043b\u0435\u0439 \u043c\u0430\u0440\u0448\u0440\u0443\u0442\u0438\u0437\u0430\u0446\u0438\u0438 \u0432\u0435\u0431 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0439.<\/p>\n<p>  \u041c\u044b \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043b\u0438 \u0441\u0430\u043c\u044b\u0435 \u043e\u0441\u043d\u043e\u0432\u043d\u044b\u0435 \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u044b \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0432\u0430\u043c \u043f\u043e\u043d\u0430\u0434\u043e\u0431\u044f\u0442\u0441\u044f \u043f\u0440\u0438 \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u0438 \u0441\u043e\u0431\u0441\u0442\u0432\u0435\u043d\u043d\u044b\u0445 \u0432\u0435\u0431 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0439 (<code>&lt;BrowserRouter.&gt;, &lt;Route.&gt;, and &lt;Link.&gt;<\/code>), \u043d\u043e \u0435\u0441\u0442\u044c \u0435\u0449\u0435 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u043e\u0432 \u0438 props \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0437\u0434\u0435\u0441\u044c \u043d\u0435 \u0440\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0435\u043d\u044b. \u041a \u0441\u0447\u0430\u0441\u0442\u044c\u044e \u0443 React Router \u0435\u0441\u0442\u044c \u043f\u0440\u0435\u043a\u0440\u0430\u0441\u043d\u0430\u044f <a href=\"https:\/\/reacttraining.com\/react-router\/web\/guides\/quick-start\">\u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430\u0446\u0438\u044f<\/a> \u0433\u0434\u0435 \u0432\u044b \u043c\u043e\u0436\u0435\u0442\u0435 \u043d\u0430\u0439\u0442\u0438 \u0431\u043e\u043b\u0435\u0435 \u043f\u043e\u0434\u0440\u043e\u0431\u043d\u043e\u0435 \u043e\u0431\u044a\u044f\u0441\u043d\u0435\u043d\u0438\u0435 \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u043e\u0432 \u0438 props. \u0422\u0430\u043a \u0436\u0435 \u0432 \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430\u0446\u0438\u0438 \u043f\u0440\u0435\u0434\u043e\u0441\u0442\u0430\u0432\u043b\u044f\u044e\u0442\u0441\u044f \u0440\u0430\u0431\u043e\u0442\u0430\u044e\u0449\u0438\u0435 \u043f\u0440\u0438\u043c\u0435\u0440\u044b \u0441 \u0438\u0441\u0445\u043e\u0434\u043d\u044b\u043c \u043a\u043e\u0434\u043e\u043c.<\/p>\n<h3><b>\u041f\u043e\u044f\u0441\u043d\u0435\u043d\u0438\u044f<\/b><\/h3>\n<p>  [1] \u2014 \u041e\u0431\u044a\u0435\u043a\u0442 location \u043e\u043f\u0438\u0441\u044b\u0432\u0430\u0435\u0442 \u0440\u0430\u0437\u043d\u044b\u0435 \u0447\u0430\u0441\u0442\u0438 URL&#8217;a<\/p>\n<pre><code class=\"javascript\">\/\/ \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043d\u044b\u0439 location  { pathname: '\/', search: '', hash: '', key: 'abc123' state: {} }<\/code><\/pre>\n<p>  [2] \u2014 \u0412\u044b \u043c\u043e\u0436\u0435\u0442\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442 <code>&lt;Route\/&gt;<\/code> \u0431\u0435\u0437 path. \u042d\u0442\u043e \u043f\u043e\u043b\u0435\u0437\u043d\u043e \u0434\u043b\u044f \u043f\u0435\u0440\u0435\u0434\u0430\u0447\u0438 \u043c\u0435\u0442\u043e\u0434\u043e\u0432 \u0438 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0445 \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0445\u0440\u0430\u043d\u044f\u0442\u044c\u0441\u044f \u0432 <code>context<\/code>.<\/p>\n<p>  [3] \u2014 \u0415\u0441\u043b\u0438 \u0432\u044b \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0435 prop <code>children<\/code> \u0442\u043e route \u0431\u0443\u0434\u0435\u0442 \u043e\u0442\u0440\u0435\u043d\u0434\u0435\u0440\u0435\u043d \u0434\u0430\u0436\u0435 \u0435\u0441\u0442\u044c path \u0438 location.pathname \u043d\u0435 \u0441\u043e\u0432\u043f\u0430\u0434\u0430\u044e\u0442. <\/p>\n<p>  [4] \u2014 \u0421\u0435\u0439\u0447\u0430\u0441 \u0432\u0435\u0434\u0435\u0442\u0441\u044f \u0440\u0430\u0431\u043e\u0442\u0430 \u043d\u0430\u0434 \u043e\u0442\u043d\u043e\u0441\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u043c\u0438 \u043f\u0443\u0442\u044f\u043c\u0438 \u0432 <code>&lt;Route\/&gt; <\/code> \u0438 <code>&lt;Link\/&gt;<\/code>. \u041e\u0442\u043d\u043e\u0441\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u0435 <code>&lt;Link\/&gt;<\/code> \u0431\u043e\u043b\u0435\u0435 \u0441\u043b\u043e\u0436\u043d\u044b\u0435 \u0447\u0435\u043c \u043c\u043e\u0433\u0443\u0442 \u043f\u043e\u043a\u0430\u0437\u0430\u0442\u044c\u0441\u044f, \u043e\u043d\u0438 \u0434\u043e\u043b\u0436\u043d\u044b \u0431\u044b\u0442\u044c \u0440\u0430\u0437\u0440\u0435\u0448\u0435\u043d\u044b \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044f \u0441\u0432\u043e\u0439 \u0440\u043e\u0434\u0438\u0442\u0435\u043b\u044c\u0441\u043a\u0438\u0439 \u043e\u0431\u044a\u0435\u043a\u0442 <code>match<\/code>, \u0430 \u043d\u0435 \u0442\u0435\u043a\u0443\u0449\u0438\u0439 URL.<\/p>\n<p>  [5] \u2014 \u042d\u0442\u043e stateless \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442. \u0412\u043d\u0443\u0442\u0440\u0438 \u0435\u0441\u0442\u044c \u0431\u043e\u043b\u044c\u0448\u0430\u044f \u0440\u0430\u0437\u043d\u0438\u0446\u0430 \u043c\u0435\u0436\u0434\u0443 <code>render <\/code>\u0438 <code>component<\/code>. Component \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442 <code>React.createElement<\/code> \u0434\u043b\u044f \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u0430, \u0432 \u0442\u043e \u0432\u0440\u0435\u043c\u044f \u043a\u0430\u043a <code>render <\/code>\u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u043a\u0430\u043a \u0444\u0443\u043d\u043a\u0446\u0438\u044f. \u0415\u0441\u043b\u0438 \u0431\u044b \u0432\u044b \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0438\u043b\u0438 inline \u0444\u0443\u043d\u043a\u0446\u0438\u044e \u0438 \u043f\u0435\u0440\u0435\u0434\u0430\u043b\u0438 \u0447\u0435\u0440\u0435\u0437 \u043d\u0435\u0435 <code>props <\/code>\u0442\u043e \u044d\u0442\u043e \u0431\u044b\u043b\u043e \u0431\u044b \u043d\u0430\u043c\u043d\u043e\u0433\u043e \u043c\u0435\u0434\u043b\u0435\u043d\u043d\u0435\u0435 \u0447\u0435\u043c \u0441 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435\u043c \u0444\u0443\u043d\u043a\u0446\u0438\u0438 <code>render<\/code>.<\/p>\n<pre><code class=\"javascript\">&lt;Route path='\/one' component={One}\/&gt; \/\/ React.createElement(props.component) &lt;Route path='\/two' render={() =&gt; &lt;Two \/&gt;}\/&gt; \/\/ props.render()<\/code><\/pre>\n<p>  [6] \u2014 \u041a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u044b <code>&lt;Route\/&gt; \u0438 &lt;Switch\/&gt;<\/code> \u043c\u043e\u0433\u0443\u0442 \u043e\u0431\u0430 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c prop location. \u042d\u0442\u043e \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u0441\u043e\u043f\u043e\u0441\u0442\u0430\u0432\u043b\u044f\u0442\u044c \u0438\u0445 \u0441 path, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0444\u0430\u043a\u0442\u0438\u0447\u0435\u0441\u043a\u0438 \u043e\u0442\u043b\u0438\u0447\u0430\u0435\u0442\u0441\u044f \u043e\u0442 \u0442\u0435\u043a\u0443\u0449\u0435\u0433\u043e URL&#8217;\u0430.<\/p>\n<p>  [7] \u2014 \u0422\u0430\u043a \u0436\u0435 \u043f\u0435\u0440\u0435\u0434\u0430\u044e\u0442 <code>staticContext<\/code>, \u043d\u043e \u043e\u043d \u043f\u043e\u043b\u0435\u0437\u0435\u043d \u0442\u043e\u043b\u044c\u043a\u043e \u043f\u0440\u0438 \u0440\u0435\u043d\u0434\u0435\u0440\u0435 \u043d\u0430 \u0441\u0435\u0440\u0432\u0435\u0440\u0435.<br \/> \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\/329996\/\"> https:\/\/habrahabr.ru\/post\/329996\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p><img decoding=\"async\" src=\"http:\/\/booborguru.com\/wp-content\/uploads\/2017\/02\/complex-layouts.jpg\" alt=\"image\"\/><\/p>\n<p>  <a href=\"https:\/\/medium.com\/@pshrmn\">\u0410\u0432\u0442\u043e\u0440 @pshrmn<\/a> \u2b1d <a href=\"https:\/\/medium.com\/@pshrmn\/a-simple-react-router-v4-tutorial-7f23ff27adf\">\u041e\u0440\u0438\u0433\u0438\u043d\u0430\u043b\u044c\u043d\u0430\u044f \u0441\u0442\u0430\u0442\u044c\u044f<\/a> \u2b1d <u>\u0412\u0440\u0435\u043c\u044f \u0447\u0442\u0435\u043d\u0438\u044f<\/u>: <b>10 \u043c\u0438\u043d\u0443\u0442<\/b><\/p>\n<p>  <a href=\"https:\/\/reacttraining.com\/react-router\/\">React Router v4<\/a> \u2014 \u044d\u0442\u043e \u043f\u0435\u0440\u0435\u0440\u0430\u0431\u043e\u0442\u0430\u043d\u043d\u044b\u0439 \u0432\u0430\u0440\u0438\u0430\u043d\u0442 \u043f\u043e\u043f\u0443\u043b\u044f\u0440\u043d\u043e\u0433\u043e React \u0434\u043e\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f. \u0417\u0430\u0432\u0438\u0441\u0438\u043c\u044b\u0435 \u043e\u0442 \u043f\u043b\u0430\u0442\u0444\u043e\u0440\u043c\u044b \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u0438 \u0440\u043e\u0443\u0442\u043e\u0432 \u0438\u0437 \u043f\u0440\u043e\u0448\u043b\u043e\u0439 \u0432\u0435\u0440\u0441\u0438\u0438 \u0431\u044b\u043b\u0438 \u0443\u0434\u0430\u043b\u0435\u043d\u044b \u0438 \u0442\u0435\u043f\u0435\u0440\u044c \u0432\u0441\u0451 \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u043f\u0440\u043e\u0441\u0442\u044b\u043c\u0438 \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u0430\u043c\u0438.   <\/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-287217","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/287217","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=287217"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/287217\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=287217"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=287217"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=287217"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}