{"id":291998,"date":"2019-07-12T15:00:37","date_gmt":"2019-07-12T15:00:37","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=291998"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=291998","title":{"rendered":"\u041f\u0438\u0448\u0435\u043c API \u0434\u043b\u044f React \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u043e\u0432, \u0447\u0430\u0441\u0442\u044c 5: \u043f\u0440\u043e\u0441\u0442\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0439\u0442\u0435 \u043a\u043e\u043c\u043f\u043e\u0437\u0438\u0446\u0438\u044e"},"content":{"rendered":"\n<div class=\"post__text post__text-html js-mediator-article\">\n<blockquote><p><a href=\"https:\/\/habr.com\/ru\/post\/459272\/\">\u041f\u0438\u0448\u0435\u043c API \u0434\u043b\u044f React \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u043e\u0432, \u0447\u0430\u0441\u0442\u044c 1: \u043d\u0435 \u0441\u043e\u0437\u0434\u0430\u0432\u0430\u0439\u0442\u0435 \u043a\u043e\u043d\u0444\u043b\u0438\u043a\u0442\u0443\u044e\u0449\u0438\u0435 \u043f\u0440\u043e\u043f\u0441\u044b<\/a><\/p>\n<p>  <a href=\"https:\/\/habr.com\/ru\/post\/459378\/\">\u041f\u0438\u0448\u0435\u043c API \u0434\u043b\u044f React \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u043e\u0432, \u0447\u0430\u0441\u0442\u044c 2: \u0434\u0430\u0432\u0430\u0439\u0442\u0435 \u043d\u0430\u0437\u0432\u0430\u043d\u0438\u044f \u043f\u043e\u0432\u0435\u0434\u0435\u043d\u0438\u044e, \u0430 \u043d\u0435 \u0441\u043f\u043e\u0441\u043e\u0431\u0430\u043c \u0432\u0437\u0430\u0438\u043c\u043e\u0434\u0435\u0439\u0441\u0442\u0432\u0438\u044f<\/a><\/p>\n<p>  <a href=\"https:\/\/habr.com\/ru\/post\/459380\/\">\u041f\u0438\u0448\u0435\u043c API \u0434\u043b\u044f React \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u043e\u0432, \u0447\u0430\u0441\u0442\u044c 3: \u043f\u043e\u0440\u044f\u0434\u043e\u043a \u043f\u0440\u043e\u043f\u0441\u043e\u0432 \u0432\u0430\u0436\u0435\u043d<\/a><\/p>\n<p>  <a href=\"https:\/\/habr.com\/ru\/post\/459414\/\">\u041f\u0438\u0448\u0435\u043c API \u0434\u043b\u044f React \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u043e\u0432, \u0447\u0430\u0441\u0442\u044c 4: \u043e\u043f\u0430\u0441\u0430\u0439\u0442\u0435\u0441\u044c \u0410\u043f\u0440\u043e\u043f\u0430\u043a\u0430\u043b\u0438\u043f\u0441\u0438\u0441\u0430!<\/a><\/p>\n<p>  <strong>\u041f\u0438\u0448\u0435\u043c API \u0434\u043b\u044f React \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u043e\u0432, \u0447\u0430\u0441\u0442\u044c 5: \u043f\u0440\u043e\u0441\u0442\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0439\u0442\u0435 \u043a\u043e\u043c\u043f\u043e\u0437\u0438\u0446\u0438\u044e<\/strong><\/p><\/blockquote>\n<p>\u0423 \u043d\u0430\u0441 \u0435\u0441\u0442\u044c \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442 \u0437\u043d\u0430\u0447\u043a\u0430:<\/p>\n<p>  <\/p>\n<p><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/6p\/n9\/vq\/6pn9vqzr96ggahurfxzbsi9hm6q.png\" alt=\"badge-1\"><\/p>\n<p>  <\/p>\n<pre><code class=\"xml\">&lt;Badge count={12} \/&gt;<\/code><\/pre>\n<p>  <\/p>\n<p>\u0412\u044b \u0432\u0438\u0434\u0435\u043b\u0438 \u0438\u0445 \u0432 \u0440\u0430\u0437\u043b\u0438\u0447\u043d\u044b\u0445 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f\u0445, \u043e\u043d\u0438 \u043f\u043e\u043a\u0430\u0437\u044b\u0432\u0430\u044e\u0442 \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u043e\u0431\u044a\u0435\u043a\u0442\u043e\u0432 \u0432 \u0432\u0438\u0434\u0435 \u0447\u0438\u0441\u043b\u0430.<\/p>\n<p>  <\/p>\n<p><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/3q\/is\/i1\/3qisi1zoghe30jofkgzpwrtqlpo.png\" alt=\"github-1\"><\/p>\n<p>  <\/p>\n<p>\u0412 <a href=\"https:\/\/github.com\/auth0\/cosmos\">cosmos<\/a> <code>Badge<\/code> (\u0437\u043d\u0430\u0447\u043e\u043a) \u0438\u043c\u0435\u0435\u0442 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0446\u0432\u0435\u0442\u043e\u0432 \u0434\u043b\u044f \u043a\u0430\u0436\u0434\u043e\u0433\u043e \u043a\u043e\u043d\u043a\u0440\u0435\u0442\u043d\u043e\u0433\u043e \u043a\u043e\u043d\u0442\u0435\u043a\u0441\u0442\u0430 (\u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044f, \u043e\u043f\u0430\u0441\u043d\u043e\u0441\u0442\u044c \u0438 \u0442.\u0434.)<\/p>\n<p><a name=\"habracut\"><\/a>  <\/p>\n<p><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/pt\/2k\/qe\/pt2kqeg_iv75cc8hsgvnntm_cba.png\" alt=\"badge-2\"><\/p>\n<p>  <\/p>\n<pre><code class=\"xml\">&lt;Badge count={12} appearance=\"information\" \/&gt; &lt;Badge count={12} appearance=\"success\" \/&gt; &lt;Badge count={12} appearance=\"default\" \/&gt; &lt;Badge count={12} appearance=\"warning\" \/&gt; &lt;Badge count={12} appearance=\"danger\" \/&gt;<\/code><\/pre>\n<p>  <\/p>\n<p>\u0423 \u044d\u0442\u043e\u0433\u043e \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u0441\u043a\u043e\u0433\u043e \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441\u0430 \u0435\u0441\u0442\u044c \u0435\u0449\u0435 \u043e\u0434\u0438\u043d \u043f\u043e\u0445\u043e\u0436\u0438\u0439 \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442 \u2014 <code>Label<\/code>.<\/p>\n<p>  <\/p>\n<p><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/te\/pr\/il\/tepril_sgr_n5azkqzgtg2ty9c0.png\" alt=\"github-2\"><\/p>\n<p>  <\/p>\n<p>\u0423 \u043d\u0435\u0433\u043e \u0442\u043e \u0436\u0435 \u0435\u0441\u0442\u044c \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0446\u0432\u0435\u0442\u043e\u0432 \u0434\u043b\u044f \u043a\u0430\u0436\u0434\u043e\u0433\u043e \u043a\u043e\u043d\u0442\u0435\u043a\u0441\u0442\u0430:<\/p>\n<p>  <\/p>\n<p><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/oe\/fx\/1p\/oefx1pgaxmbdhdqedyuggafito0.png\" alt=\"label-2\"><\/p>\n<p>  <\/p>\n<pre><code class=\"xml\">&lt;Label text=\"private\" appearance=\"information\" \/&gt; &lt;Label text=\"private\" appearance=\"success\" \/&gt; &lt;Label text=\"private\" appearance=\"default\" \/&gt; &lt;Label text=\"private\" appearance=\"warning\" \/&gt; &lt;Label text=\"private\" appearance=\"danger\" \/&gt;<\/code><\/pre>\n<p>  <\/p>\n<p>\u041f\u043e\u0441\u043c\u043e\u0442\u0440\u0438\u0442\u0435 \u043d\u0430 \u044d\u0442\u0438 \u0434\u0432\u0430 \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u0430 \u0438 \u0441\u043a\u0430\u0436\u0438\u0442\u0435 \u043e\u0434\u043d\u0443 \u0445\u043e\u0440\u043e\u0448\u0443\u044e \u0438 \u043e\u0434\u043d\u0443 \u043f\u043b\u043e\u0445\u0443\u044e \u0432\u0435\u0449\u044c \u043e\u0431 \u0438\u0445 API (\u043e\u0431 \u0438\u0445 \u043f\u0440\u043e\u043f\u0441\u0430\u0445)<\/p>\n<p>  <\/p>\n<p><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/3o\/ni\/r2\/3onir2phh7ripkv6kjo6kipmxlo.png\" alt=\"together 2\"><\/p>\n<p>  <\/p>\n<pre><code class=\"xml\">&lt;Badge count={12} appearance=\"information\" \/&gt; &lt;Label text=\"private\" appearance=\"information\" \/&gt;<\/code><\/pre>\n<p>  <\/p>\n<h2 id=\"chto-horosho\">\u0427\u0442\u043e \u0445\u043e\u0440\u043e\u0448\u043e<\/h2>\n<p>  <\/p>\n<p>\u0423 \u043e\u0431\u043e\u0438\u0445 \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u043e\u0432 \u0435\u0441\u0442\u044c \u043e\u0434\u0438\u043d\u0430\u043a\u043e\u0432\u044b\u0439 \u043f\u0440\u043e\u043f \u0434\u043b\u044f \u0432\u043d\u0435\u0448\u043d\u0435\u0433\u043e \u0432\u0438\u0434\u0430: <code>appearance<\/code>, \u044d\u0442\u043e \u0437\u0434\u043e\u0440\u043e\u0432\u043e. \u041c\u0430\u043b\u043e \u0442\u043e\u0433\u043e, \u0443 \u043d\u0438\u0445 \u043e\u0434\u0438\u043d\u0430\u043a\u043e\u0432\u044b\u0435 \u0432\u0430\u0440\u0438\u0430\u043d\u0442\u044b \u0434\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u043f\u0440\u043e\u043f\u0430! \u0415\u0441\u043b\u0438 \u0432\u044b \u0437\u043d\u0430\u0435\u0442\u0435 \u043a\u0430\u043a \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c <code>appearance<\/code> \u0432 <code>Badge<\/code>, \u0442\u043e \u0432\u044b \u0443\u0436\u0435 \u0437\u043d\u0430\u0435\u0442\u0435 \u043a\u0430\u043a \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c <code>appearance<\/code> \u0432 <code>Label<\/code><\/p>\n<p>  <\/p>\n<blockquote><p>\u0421\u0442\u0440\u0435\u043c\u0438\u0442\u0435\u0441\u044c \u043a \u043f\u043e\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u043d\u044b\u043c \u043f\u0440\u043e\u043f\u0441\u0430\u043c \u043c\u0435\u0436\u0434\u0443 \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u0430\u043c\u0438<\/p>\n<p>  \u0421\u043e\u0432\u0435\u0442 \u2116 2 \u0438\u0437 <a href=\"https:\/\/habr.com\/ru\/post\/459378\/\">\u041f\u0438\u0448\u0435\u043c API \u0434\u043b\u044f React \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u043e\u0432, \u0447\u0430\u0441\u0442\u044c 2: \u0434\u0430\u0432\u0430\u0439\u0442\u0435 \u043d\u0430\u0437\u0432\u0430\u043d\u0438\u044f \u043f\u043e\u0432\u0435\u0434\u0435\u043d\u0438\u044e, \u0430 \u043d\u0435 \u0441\u043f\u043e\u0441\u043e\u0431\u0430\u043c \u0432\u0437\u0430\u0438\u043c\u043e\u0434\u0435\u0439\u0441\u0442\u0432\u0438\u044f<\/a><\/p><\/blockquote>\n<p>  <\/p>\n<h2 id=\"chto-ploho\">\u0427\u0442\u043e \u043f\u043b\u043e\u0445\u043e<\/h2>\n<p>  <\/p>\n<p>\u0422\u043e, \u043a\u0430\u043a \u043e\u043d\u0438 \u043f\u0440\u0438\u043d\u0438\u043c\u0430\u044e\u0442 \u0441\u0432\u043e\u0438 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f, \u043e\u0442\u043b\u0438\u0447\u0430\u0435\u0442\u0441\u044f. \u0423 \u043d\u0438\u0445 \u043e\u0431\u043e\u0438\u0445 \u0441\u0432\u043e\u0439 \u0432\u0430\u0440\u0438\u0430\u043d\u0442.<\/p>\n<p>  <\/p>\n<p>\u041f\u043e\u0434\u0441\u0447\u0435\u0442 \u2014 <code>count<\/code>, \u0438\u043c\u0435\u0435\u0442 \u0441\u043c\u044b\u0441\u043b \u0432 \u0440\u0430\u043c\u043a\u0430\u0445 \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u0430 <code>Badge<\/code>, \u043d\u043e \u0441 \u0443\u0447\u0435\u0442\u043e\u043c \u0432\u0441\u0435\u0445 \u043e\u0441\u0442\u0430\u043b\u044c\u043d\u044b\u0445 \u0432\u0430\u0448\u0438\u0445 \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u043e\u0432 \u044d\u0442\u043e \u0434\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u0439 API \u043e \u043a\u043e\u0442\u043e\u0440\u043e\u043c \u043f\u0440\u0438\u0434\u0435\u0442\u0441\u044f \u043f\u043e\u043c\u043d\u0438\u0442\u044c \u0432\u0430\u0448\u0435\u0439 \u043a\u043e\u043c\u0430\u043d\u0434\u0435 \u0438 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f\u043c (\u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u0430\u043c).<\/p>\n<p>  <\/p>\n<h2 id=\"davayte-uluchshim-etot-api\">\u0414\u0430\u0432\u0430\u0439\u0442\u0435 \u0443\u043b\u0443\u0447\u0448\u0438\u043c \u044d\u0442\u043e\u0442 API<\/h2>\n<p>  <\/p>\n<p>\u0427\u0442\u043e\u0431\u044b \u0431\u044b \u0431\u044b\u0442\u044c \u043f\u043e\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u043d\u044b\u043c, \u044f \u043d\u0430\u0437\u043e\u0432\u0443 \u044d\u0442\u043e\u0442 \u043f\u0440\u043e\u043f <code>content<\/code>, \u044d\u0442\u043e \u043d\u0430\u0438\u0431\u043e\u043b\u0435\u0435 \u043e\u0431\u0449\u0435\u0435 \u043d\u0430\u0437\u0432\u0430\u043d\u0438\u0435 \u043a\u043e\u0442\u043e\u0440\u043e\u0435 \u044f \u0441\u043c\u043e\u0433 \u043f\u0440\u0438\u0434\u0443\u043c\u0430\u0442\u044c, \u2014 \u0431\u043e\u043b\u0435\u0435 \u043e\u0431\u0449\u0435\u0435 \u0447\u0435\u043c \u043f\u0440\u043e\u0441\u0442\u043e label, text \u0438\u043b\u0438 value.<\/p>\n<p>  <\/p>\n<p><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/3o\/ni\/r2\/3onir2phh7ripkv6kjo6kipmxlo.png\" alt=\"together 2\"><\/p>\n<p>  <\/p>\n<pre><code class=\"xml\">&lt;Badge content=\"12\" appearance=\"information\" \/&gt; &lt;Label content=\"private\" appearance=\"information\" \/&gt;<\/code><\/pre>\n<p>  <\/p>\n<p>\u041c\u044b \u043f\u043e\u0442\u0435\u0440\u044f\u043b\u0438 \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u0443\u044e \u0434\u0435\u0442\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044e, \u043d\u043e \u043f\u043e\u043b\u0443\u0447\u0438\u043b\u0438 \u0431\u043e\u043b\u044c\u0448\u0443\u044e \u043f\u043e\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u044c. \u041c\u044b \u0432\u0441\u0435 \u0435\u0449\u0435 \u043c\u043e\u0436\u0435\u043c \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u044c \u0442\u0438\u043f \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e <a href=\"https:\/\/www.npmjs.com\/package\/prop-types\">prop-types<\/a>, \u0442\u0430\u043a \u0447\u0442\u043e \u0434\u0443\u043c\u0430\u044e, \u0447\u0442\u043e \u044d\u0442\u043e \u0445\u043e\u0440\u043e\u0448\u0438\u0439 \u043a\u043e\u043c\u043f\u0440\u043e\u043c\u0438\u0441\u0441.<\/p>\n<p>  <\/p>\n<p>\u041d\u043e \u043f\u043e\u0434\u043e\u0436\u0434\u0438\u0442\u0435, \u0432 React-\u0435 \u0443\u0436\u0435 \u0435\u0441\u0442\u044c \u043c\u043d\u043e\u0433\u043e\u0446\u0435\u043b\u0435\u0432\u043e\u0439 <code>content<\/code> \u043f\u0440\u043e\u043f, \u043e\u043d \u043d\u0430\u0437\u044b\u0432\u0430\u0435\u0442\u0441\u044f <code>children<\/code> \u2014 \u0434\u043e\u0447\u0435\u0440\u043d\u0438\u0439.<\/p>\n<p>  <\/p>\n<blockquote><p>\u041d\u0435 \u043f\u0435\u0440\u0435\u0438\u0437\u043e\u0431\u0440\u0435\u0442\u0430\u0439\u0442\u0435 <code>props.children.<\/code><\/p>\n<p>  \u0415\u0441\u043b\u0438 \u0432\u044b \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0438\u043b\u0438 \u043f\u0440\u043e\u043f\u0441\u044b, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043f\u0440\u0438\u043d\u0438\u043c\u0430\u044e\u0442 \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u043b\u044c\u043d\u044b\u0435 \u0434\u0430\u043d\u043d\u044b\u0435, \u043d\u0435 \u043e\u0441\u043d\u043e\u0432\u0430\u043d\u043d\u044b\u0435 \u043d\u0430 \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0435 \u0434\u0430\u043d\u043d\u044b\u0445, \u0432\u0435\u0440\u043e\u044f\u0442\u043d\u043e, \u043b\u0443\u0447\u0448\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c composition (\u043a\u043e\u043c\u043f\u043e\u0437\u0438\u0446\u0438\u044e) \u2014 <a href=\"https:\/\/twitter.com\/jxnblk\">Brent Jackson<\/a><\/p><\/blockquote>\n<p>\u0412\u043e\u0442 \u0441\u043e\u0432\u0435\u0442 \u044d\u0442\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0438 \u2014 <strong>\u041f\u0440\u0438 \u0432\u044b\u0431\u043e\u0440\u0435 \u043c\u0435\u0436\u0434\u0443 \u043a\u043e\u043c\u043f\u043e\u0437\u0438\u0446\u0438\u0435\u0439 \u0438 \u043f\u0440\u043e\u043f\u0441\u0430\u043c\u0438, \u0432\u044b\u0431\u0438\u0440\u0430\u0439\u0442\u0435 \u043a\u043e\u043c\u043f\u043e\u0437\u0438\u0446\u0438\u044e<\/strong>.<\/p>\n<p>  <\/p>\n<p>\u0414\u0430\u0432\u0430\u0439\u0442\u0435 \u043f\u0440\u043e\u0432\u0435\u0434\u0435\u043c \u0440\u0435\u0444\u0430\u043a\u0442\u043e\u0440\u0438\u043d\u0433 \u044d\u0442\u043e\u0433\u043e API \u043f\u0440\u0438 \u043f\u043e\u043c\u043e\u0449\u0438 <code>children<\/code> \u2014 \u0434\u043e\u0447\u0435\u0440\u043d\u0438\u0445 \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u043e\u0432:<\/p>\n<p>  <\/p>\n<p><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/3o\/ni\/r2\/3onir2phh7ripkv6kjo6kipmxlo.png\" alt=\"together 2\"><\/p>\n<p>  <\/p>\n<pre><code class=\"xml\">&lt;Badge appearance=\"information\"&gt;12      &lt;\/Badge&gt; &lt;Label appearance=\"information\"&gt;Private &lt;\/Label&gt;<\/code><\/pre>\n<p>  <\/p>\n<p>\u0412\u044b\u0433\u043b\u044f\u0434\u0438\u0442 \u043e\u0442\u043b\u0438\u0447\u043d\u043e.<\/p>\n<p>  <\/p>\n<p>\u0411\u043e\u043d\u0443\u0441: \u043a\u043e\u0433\u0434\u0430 \u0432\u044b \u0432\u043c\u0435\u0441\u0442\u043e \u043f\u0440\u043e\u043f\u0430 <code>text<\/code> \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0435 <code>children<\/code>, \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e\u0449\u0438\u0439 \u044d\u0442\u043e\u0442 \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442 \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u0442 \u0431\u043e\u043b\u044c\u0448\u0435 \u0433\u0438\u0431\u043a\u043e\u0441\u0442\u0438 \u0431\u0435\u0437 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e\u0441\u0442\u0438 \u0438\u0437\u043c\u0435\u043d\u044f\u0442\u044c \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442.<\/p>\n<p>  <\/p>\n<p>\u041a \u043f\u0440\u0438\u043c\u0435\u0440\u0443, \u0432\u043e\u0442 <code>\u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u0435 \u043f\u0440\u0435\u0434\u0443\u043f\u0440\u0435\u0436\u0434\u0435\u043d\u0438\u0435<\/code>, \u0432 \u043d\u0435\u043c, \u044f \u0445\u043e\u0447\u0443 \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u0438\u043a\u043e\u043d\u043a\u0443 \u043f\u0435\u0440\u0435\u0434 \u0442\u0435\u043a\u0441\u0442\u043e\u043c.<\/p>\n<p>  <\/p>\n<p><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/3r\/9r\/vs\/3r9rvsjdq1zrygc7obhzp225e8w.png\" alt=\"alert\"><\/p>\n<p>  <\/p>\n<p>\u0418\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044f <code>children<\/code> \u044f \u043c\u043e\u0433\u0443 \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u0438\u043a\u043e\u043d\u043a\u0443 \u0432 \u044d\u0442\u043e <code>\u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u0435 \u043f\u0440\u0435\u0434\u0443\u043f\u0440\u0435\u0436\u0434\u0435\u043d\u0438\u0435<\/code>, \u043d\u0435 \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u044f\u0441\u044c \u043a \u044d\u0442\u043e\u043c\u0443 \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u0443 \u0438 \u043d\u0435 \u043c\u0435\u043d\u044f\u044f \u0435\u0433\u043e.<\/p>\n<p>  <\/p>\n<pre><code class=\"xml\">\/\/ \u041f\u043b\u043e\u0445\u043e - \u043f\u0440\u0438\u0445\u043e\u0434\u0438\u0442\u044c\u0441\u044f \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u0442\u044c \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u043a\u0443 \u0438\u043a\u043e\u043d\u043e\u043a &lt;Alert type=\"warning\" icon=\"warning\" text=\"This is an important message!\" \/&gt;  \/\/ \u0425\u043e\u0440\u043e\u0448\u043e &lt;Alert type=\"warning\"&gt;   &lt;Icon name=\"warning\" \/&gt; This is an important message! &lt;\/Alert&gt;<\/code><\/pre>\n<p>  <\/p>\n<p>\u041f\u043e \u0441\u043e\u0432\u043f\u0430\u0434\u0435\u043d\u0438\u044e, \u043a\u043e\u0433\u0434\u0430 \u044f \u043f\u0438\u0441\u0430\u043b \u044d\u0442\u043e\u0442 \u0442\u0435\u043a\u0441\u0442, \u044f \u0443\u0432\u0438\u0434\u0435\u043b <a href=\"https:\/\/twitter.com\/brad_frost\/status\/1090733766950223878\">\u0442\u0432\u0438\u0442 \u0411\u0440\u044d\u0434\u0430 \u0424\u0440\u043e\u0441\u0442\u0430<\/a>:<\/p>\n<p>  <\/p>\n<blockquote><p>\u042d\u0439, React \u0434\u0440\u0443\u0437\u044c\u044f, \u043d\u0443\u0436\u043d\u0430 \u043d\u0435\u0431\u043e\u043b\u044c\u0448\u0430\u044f \u043f\u043e\u043c\u043e\u0449\u044c. \u042f \u043f\u0440\u043e\u0434\u043e\u043b\u0436\u0430\u044e \u0441\u0442\u0430\u043b\u043a\u0438\u0432\u0430\u0442\u044c\u0441\u044f \u0441 \u044d\u0442\u0438\u043c \u0448\u0430\u0431\u043b\u043e\u043d\u043e\u043c, \u0433\u0434\u0435 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u043d\u044b\u0435 \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u044b (\u043e\u0441\u043e\u0431\u0435\u043d\u043d\u043e \u0441\u043f\u0438\u0441\u043a\u0438) \u043c\u043e\u0433\u0443\u0442 \u0431\u044b\u0442\u044c \u0440\u0430\u0437\u0434\u0435\u043b\u0435\u043d\u044b \u043d\u0430 \u0431\u043e\u043b\u0435\u0435 \u043c\u0435\u043b\u043a\u0438\u0435 \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u044b \u0438\u043b\u0438 \u0443\u043f\u0440\u0430\u0432\u043b\u044f\u0442\u044c\u0441\u044f \u043f\u0443\u0442\u0435\u043c \u043f\u0435\u0440\u0435\u0434\u0430\u0447\u0438 \u043e\u0431\u044a\u0435\u043a\u0442\u0430. \u041a\u0430\u043a\u043e\u0439 \u0438\u0437 \u0432\u0430\u0440\u0438\u0430\u043d\u0442\u043e\u0432 \u043b\u0443\u0447\u0448\u0435?<\/p><\/blockquote>\n<p><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/rb\/rm\/6k\/rbrm6kcobqnadsodp6tck7rjpku.jpeg\" alt=\"code\"><\/p>\n<p>  <\/p>\n<p>\u0412\u044b\u0433\u043b\u044f\u0434\u0438\u0442 \u0437\u043d\u0430\u043a\u043e\u043c\u043e?<\/p>\n<p>  <\/p>\n<p>\u041f\u0440\u0435\u0436\u0434\u0435 \u0432\u0441\u0435\u0433\u043e, \u0434\u0430\u0432\u0430\u0439\u0442\u0435 \u043d\u0435 \u0431\u0443\u0434\u0435\u043c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u043f\u0440\u043e\u043f <code>text<\/code> \u0438 \u0432\u043c\u0435\u0441\u0442\u043e \u044d\u0442\u043e\u0433\u043e \u0431\u0443\u0434\u0435\u043c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c <code>children<\/code>.<\/p>\n<p>  <\/p>\n<pre><code class=\"xml\">\/\/ \u0432\u043c\u0435\u0441\u0442\u043e \u044d\u0442\u043e\u0433\u043e: &lt;Breadcrumb text=\"Home\" href=\"\/child\" \/&gt;  \/\/ \u043d\u0430\u043f\u0438\u0448\u0435\u043c \u044d\u0442\u043e: &lt;Breadcrumb href=\"\/child\"&gt;Home&lt;\/Breadcrumb&gt;<\/code><\/pre>\n<p>  <\/p>\n<p>\u0422\u0435\u043f\u0435\u0440\u044c, \u043a\u043e\u0433\u0434\u0430 \u043c\u044b \u0440\u0430\u0437\u043e\u0431\u0440\u0430\u043b\u0438\u0441\u044c \u0441 \u044d\u0442\u0438\u043c, \u0434\u0430\u0432\u0430\u0439\u0442\u0435 \u043f\u043e\u0433\u043e\u0432\u043e\u0440\u0438\u043c \u043e\u0431 \u044d\u0442\u0438\u0445 \u0434\u0432\u0443\u0445 \u0432\u0430\u0440\u0438\u0430\u043d\u0442\u0430\u0445 API.<\/p>\n<p>  <\/p>\n<p>\u041a\u0430\u043a \u043d\u0435 \u0441\u043b\u043e\u0436\u043d\u043e \u0434\u043e\u0433\u0430\u0434\u0430\u0442\u044c\u0441\u044f, \u043c\u043d\u0435 \u043d\u0440\u0430\u0432\u0438\u0442\u0441\u044f \u043f\u0435\u0440\u0432\u044b\u0439.<\/p>\n<p>  <\/p>\n<ol>\n<li>\u0412\u0430\u043c \u043d\u0435 \u043d\u0443\u0436\u043d\u043e \u0434\u0443\u043c\u0430\u0442\u044c \u043e \u0442\u043e\u043c \u043a\u0430\u043a \u043d\u0430\u0437\u044b\u0432\u0430\u0435\u0442\u0441\u044f \u043f\u0440\u043e\u043f \u2014 <code>text<\/code>? <code>label<\/code>? <strong>\u042d\u0442\u043e \u043f\u0440\u043e\u0441\u0442\u043e <code>children<\/code>.<\/strong><\/li>\n<li>\u0412\u044b \u043c\u043e\u0436\u0435\u0442\u0435 \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u0441\u0432\u043e\u0435 <code>className<\/code> \u0438\u043b\u0438 <code>target<\/code> \u043a \u043d\u0435\u043c\u0443, \u0435\u0441\u043b\u0438 \u043d\u0443\u0436\u043d\u043e. \u0414\u043b\u044f \u0432\u0442\u043e\u0440\u043e\u0433\u043e \u0432\u0430\u0440\u0438\u0430\u043d\u0442\u0430 \u0432\u0430\u043c \u043d\u0443\u0436\u043d\u043e \u0443\u0431\u0435\u0434\u0438\u0442\u044c\u0441\u044f, \u0447\u0442\u043e \u043e\u043d \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u0435\u0442 \u044d\u0442\u0438 \u0441\u0432\u043e\u0439\u0441\u0442\u0432\u0430 \u0438\u043b\u0438 \u043f\u0440\u043e\u0441\u0442\u043e \u043f\u0435\u0440\u0435\u0434\u0430\u0435\u0442 \u0438\u0445 \u0431\u0430\u0437\u043e\u0432\u043e\u043c\u0443 \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u0443.<\/li>\n<li>\u042d\u0442\u043e \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u043e\u0431\u0435\u0440\u043d\u0443\u0442\u044c \u0434\u043e\u0447\u0435\u0440\u043d\u0438\u0439 \u044d\u043b\u0435\u043c\u0435\u043d\u0442 \u0432 \u043a\u043e\u043d\u0442\u0435\u043a\u0441\u0442 \u0438\u043b\u0438 \u0432 \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442 \u0431\u043e\u043b\u0435\u0435 \u0432\u044b\u0441\u043e\u043a\u043e\u0433\u043e \u0443\u0440\u043e\u0432\u043d\u044f.<\/li>\n<\/ol>\n<p>  <\/p>\n<h2 id=\"isklyuchenie-iz-pravila\">\u0418\u0441\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435 \u0438\u0437 \u043f\u0440\u0430\u0432\u0438\u043b\u0430:<\/h2>\n<p>  <\/p>\n<p>\u0427\u0442\u043e, \u0435\u0441\u043b\u0438 \u0411\u0440\u044d\u0434 \u0445\u043e\u0447\u0435\u0442 \u0437\u0430\u043f\u0440\u0435\u0442\u0438\u0442\u044c \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u0443 \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0442\u044c \u043a\u0430\u043a\u0438\u0435-\u043b\u0438\u0431\u043e \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0438, \u043e \u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u044f \u0443\u043f\u043e\u043c\u0438\u043d\u0430\u043b \u0432\u044b\u0448\u0435? \u0422\u043e\u0433\u0434\u0430 \u0434\u0430\u0432\u0430\u0442\u044c \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u0443 \u0431\u043e\u043b\u044c\u0448\u0435 \u0433\u0438\u0431\u043a\u043e\u0441\u0442\u0438, \u0432 \u0435\u0433\u043e \u0441\u043b\u0443\u0447\u0430\u0435, \u0431\u0443\u0434\u0435\u0442 \u043e\u0448\u0438\u0431\u043a\u043e\u0439!<\/p>\n<p>  <\/p>\n<p>\u0412\u043e\u0442 <a href=\"https:\/\/twitter.com\/siddharthkp\/status\/1090841912444039168\">\u043c\u043e\u0439 \u043e\u0442\u0432\u0435\u0442 \u0411\u0440\u044d\u0434\u0443<\/a>.<\/p>\n<p>  <\/p>\n<h2 id=\"bolshe-primerov\">\u0411\u043e\u043b\u044c\u0448\u0435 \u043f\u0440\u0438\u043c\u0435\u0440\u043e\u0432<\/h2>\n<p>  <\/p>\n<p>\u0412\u043e\u0442 \u0435\u0449\u0435 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u043f\u0440\u0438\u043c\u0435\u0440\u043e\u0432 \u0442\u043e\u0433\u043e, \u043a\u0430\u043a \u044d\u0442\u043e\u0442 \u0441\u043e\u0432\u0435\u0442 \u043c\u043e\u0436\u0435\u0442 \u0443\u043b\u0443\u0447\u0448\u0438\u0442\u044c \u0432\u0430\u0448 \u043a\u043e\u0434, \u043f\u043e\u0441\u043b\u0435\u0434\u043d\u0438\u0439 \u043c\u043e\u0439 \u043b\u044e\u0431\u0438\u043c\u044b\u0439.<\/p>\n<p>  <\/p>\n<p>\u0424\u043e\u0440\u043c\u044b \u2014 \u043e\u0442\u043b\u0438\u0447\u043d\u044b\u0439 \u043f\u0440\u0438\u043c\u0435\u0440 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f, \u043c\u044b \u0445\u043e\u0442\u0438\u043c \u0443\u043f\u0440\u0430\u0432\u043b\u044f\u0442\u044c \u043c\u0430\u043a\u0435\u0442\u043e\u043c \u0444\u043e\u0440\u043c\u044b, \u043e\u0442\u043e\u0431\u0440\u0430\u0436\u0430\u0442\u044c \u043e\u0448\u0438\u0431\u043a\u0438 \u0438 \u0442.\u0434. \u041d\u043e \u0432 \u0442\u043e \u0436\u0435 \u0432\u0440\u0435\u043c\u044f \u043c\u044b \u043d\u0435 \u0445\u043e\u0442\u0438\u043c \u043b\u0438\u0448\u0430\u0442\u044c\u0441\u044f \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u0435\u0439 \u0434\u043b\u044f \u0440\u0430\u0441\u0448\u0438\u0440\u0435\u043d\u0438\u044f.<\/p>\n<p>  <\/p>\n<pre><code class=\"xml\">\/\/ #1 \u041f\u043b\u043e\u0445\u043e &lt;FormTextInput   type=\"text\"   label=\"Name\"   id=\"name-input\" \/&gt; \/\/ \u043a \u0447\u0435\u043c\u0443 \u043e\u0442\u043d\u043e\u0441\u0438\u0442\u0441\u044f \u044d\u0442\u043e\u0442 id, \/\/ \u043a label \u0438\u043b\u0438 \u043a input?  \/\/ #2 \u0425\u043e\u0440\u043e\u0448\u043e &lt;FormField&gt;   &lt;Label&gt;Field label&lt;\/Label&gt;   &lt;TextInput id=\"name-input\" type=\"text\" placeholder=\"What's your name?\" \/&gt; &lt;\/FormField&gt;  \/\/ #3 \u0442\u043e \u0436\u0435 \u0445\u043e\u0440\u043e\u0448\u043e &lt;FormField label=\"Field label\"&gt;   &lt;TextInput id=\"name-input\" type=\"text\" placeholder=\"What's your name?\" \/&gt; &lt;\/FormField&gt;<\/code><\/pre>\n<p>  <\/p>\n<p>\u041f\u043e\u0441\u043b\u0435\u0434\u043d\u0438\u0439 \u043f\u0440\u0438\u043c\u0435\u0440 \u043e\u0441\u043e\u0431\u0435\u043d\u043d\u043e \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u044b\u0439.<\/p>\n<p>  <\/p>\n<p>\u0418\u043d\u043e\u0433\u0434\u0430 \u0432\u0430\u043c \u043d\u0443\u0436\u0435\u043d \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442 \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0431\u0443\u0434\u0435\u0442 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c\u0441\u044f \u0432 \u043e\u0447\u0435\u043d\u044c \u0440\u0430\u0437\u043d\u044b\u0445 \u0441\u0438\u0442\u0443\u0430\u0446\u0438\u044f\u0445. \u041d\u0435 \u043f\u0440\u043e\u0441\u0442\u043e \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442 \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0431\u0443\u0434\u0435\u0442 \u0433\u0438\u0431\u043e\u043a, \u0438 \u043f\u0440\u0438 \u044d\u0442\u043e\u043c \u0432\u0441\u0435 \u0435\u0449\u0435 \u0438\u043c\u0435\u0442\u044c \u043f\u0440\u043e\u0441\u0442\u043e\u0439 API.<\/p>\n<p>  <\/p>\n<p>\u0412\u043e\u0442 \u0433\u0434\u0435 \u043d\u0430 \u043f\u043e\u043c\u043e\u0449\u044c \u043f\u0440\u0438\u0445\u043e\u0434\u0438\u0442 \u0438\u043d\u0432\u0435\u0440\u0441\u0438\u044f \u0443\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u044f \u2014 \u043f\u0443\u0441\u0442\u044c \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u0430 \u0441\u0430\u043c \u0440\u0435\u0448\u0430\u0435\u0442 \u0447\u0442\u043e \u0440\u0435\u043d\u0434\u0435\u0440\u0438\u0442\u044c. \u0412 \u043c\u0438\u0440\u0435 React-\u0430 \u044d\u0442\u043e\u0442 \u043f\u0430\u0442\u0442\u0435\u0440\u043d \u043d\u0430\u0437\u044b\u0432\u0430\u0435\u0442\u0441\u044f <strong>render prop pattern<\/strong> (\u043f\u0430\u0442\u0442\u0435\u0440\u043d \u0440\u0435\u043d\u0434\u0435\u0440-\u043f\u0440\u043e\u043f\u0441\u043e\u0432).<\/p>\n<p>  <\/p>\n<blockquote><p>\u041a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442 \u0441 \u0440\u0435\u043d\u0434\u0435\u0440-\u043f\u0440\u043e\u043f\u043e\u043c \u0431\u0435\u0440\u0451\u0442 \u0444\u0443\u043d\u043a\u0446\u0438\u044e, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u0442 React-\u044d\u043b\u0435\u043c\u0435\u043d\u0442, \u0438 \u0432\u044b\u0437\u044b\u0432\u0430\u0435\u0442 \u0435\u0451 \u0432\u043c\u0435\u0441\u0442\u043e \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 \u0441\u043e\u0431\u0441\u0442\u0432\u0435\u043d\u043d\u043e\u0433\u043e \u0440\u0435\u043d\u0434\u0435\u0440\u0430.<\/p>\n<p>  \u0438\u0437 \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430\u0446\u0438\u0438 <a href=\"https:\/\/ru.reactjs.org\/docs\/render-props.html\">React \u0420\u0435\u043d\u0434\u0435\u0440-\u043f\u0440\u043e\u043f\u0441\u044b<br \/>  <\/a><\/p><\/blockquote>\n<p>\u041e\u0434\u043d\u0438\u043c \u0438\u0437 \u043d\u0430\u0438\u0431\u043e\u043b\u0435\u0435 \u043f\u043e\u043f\u0443\u043b\u044f\u0440\u043d\u044b\u0445 \u043f\u0440\u0438\u043c\u0435\u0440\u043e\u0432 \u0440\u0435\u043d\u0434\u0435\u0440-\u043f\u0440\u043e\u043f\u0441\u043e\u0432 \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u043e\u0444\u0438\u0446\u0438\u0430\u043b\u044c\u043d\u044b\u0439 Context API.<\/p>\n<p>  <\/p>\n<p>\u0412 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u043c \u043f\u0440\u0438\u043c\u0435\u0440\u0435 \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442 <code>App<\/code> \u043a\u043e\u043d\u0442\u0440\u043e\u043b\u0438\u0440\u0443\u0435\u0442 \u0434\u0430\u043d\u043d\u044b\u0435, \u043d\u043e \u043d\u0435 \u043a\u043e\u043d\u0442\u0440\u043e\u043b\u0438\u0440\u0443\u0435\u0442 \u0438\u0445 \u0440\u0435\u043d\u0434\u0435\u0440\u0438\u043d\u0433, \u043e\u043d \u043f\u0435\u0440\u0435\u0434\u0430\u0435\u0442 \u044d\u0442\u043e\u0442 \u043a\u043e\u043d\u0442\u0440\u043e\u043b\u044c \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u0443 <code>Counter<\/code> (\u0441\u0447\u0435\u0442\u0447\u0438\u043a).<\/p>\n<p>  <\/p>\n<pre><code class=\"javascript\">\/\/ \u0441\u043e\u0437\u0434\u0430\u0435\u043c \u043d\u043e\u0432\u044b\u0439 \u043a\u043e\u043d\u0442\u0435\u043a\u0441\u0442 const MyContext = React.createContext()  \/\/ \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u043f\u0435\u0440\u0435\u0434\u0430\u0435\u0442\u0441\u044f \u0432\u043d\u0438\u0437 \/\/ \u0447\u0435\u0440\u0435\u0437 \u043a\u043e\u043d\u0442\u0435\u043a\u0441\u0442 \u043f\u0440\u043e\u0432\u0430\u0439\u0434\u0435\u0440 function App() {   return (     &lt;MyContext.Provider value=\"5\"&gt;       &lt;Counter \/&gt;     &lt;\/MyContext.Provider&gt;   ) }  \/\/ \u0438 \u043f\u043e\u0442\u0440\u0435\u0431\u043b\u044f\u0435\u0442\u0441\u044f \u0447\u0435\u0440\u0435\u0437 \/\/ \u043f\u043e\u0442\u0440\u0435\u0431\u0438\u0442\u0435\u043b\u044f \u043a\u043e\u043d\u0442\u0435\u043a\u0441\u0442\u0430 function Counter() {   return (     &lt;MyContext.Consumer&gt;       {value =&gt; (         &lt;div className=\"counter\"&gt;the count is: {value}&lt;\/div&gt;       )}     &lt;\/MyContext.Consumer&gt;   ) }<\/code><\/pre>\n<p>  <\/p>\n<p>\u0417\u0430\u043c\u0435\u0442\u0438\u043b\u0438 \u0447\u0442\u043e-\u043d\u0438\u0431\u0443\u0434\u044c \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u043e\u0435 \u0432 \u044d\u0442\u043e\u043c <code>Consumer<\/code> API?<\/p>\n<p>  <\/p>\n<p>\u0412\u043c\u0435\u0441\u0442\u043e \u0442\u043e\u0433\u043e \u0447\u0442\u043e\u0431\u044b \u0441\u043e\u0437\u0434\u0430\u0432\u0430\u0442\u044c \u043d\u043e\u0432\u044b\u0439 API, \u043e\u043d \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442 <code>children<\/code>, \u0447\u0442\u043e\u0431\u044b \u043f\u0440\u0438\u043d\u044f\u0442\u044c \u0444\u0443\u043d\u043a\u0446\u0438\u044e \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u0441\u043a\u0430\u0436\u0435\u0442 \u0435\u043c\u0443 \u043a\u0430\u043a \u0440\u0435\u043d\u0434\u0435\u0440\u0438\u0442\u044c!<\/p>\n<p>  <\/p>\n<pre><code class=\"xml\">\/\/ \u041f\u043b\u043e\u0445\u043e &lt;Consumer render={value =&gt; (   &lt;div className=\"counter\"&gt;the count is: {value}&lt;\/div&gt; )} \/&gt;  \/\/ \u0425\u043e\u0440\u043e\u0448\u043e &lt;Consumer&gt;   {value =&gt; (     &lt;div className=\"counter\"&gt;the count is: {value}&lt;\/div&gt;   )} &lt;\/Consumer&gt;<\/code><\/pre>\n<p>  <\/p>\n<p>\u0412\u0435\u0440\u043d\u0438\u0442\u0435\u0441\u044c \u043a \u0441\u0432\u043e\u0435\u043c\u0443 \u043a\u043e\u0434\u0443 \u0438 \u043d\u0430\u0439\u0434\u0438\u0442\u0435 \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442 \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043f\u0440\u0438\u043d\u0438\u043c\u0430\u0435\u0442 \u043a\u0430\u043a\u0438\u0435 \u043b\u0438\u0431\u043e \u043f\u0440\u043e\u043f\u0441\u044b, \u043a\u043e\u0433\u0434\u0430 \u043e\u043d, \u043f\u0440\u0438 \u044d\u0442\u043e\u043c, \u043c\u043e\u0436\u0435\u0442 \u043b\u0435\u0433\u043a\u043e <strong>\u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c <code>children<\/code><\/strong>.<\/p>\n<\/div>\n<p>               <script class=\"js-mediator-script\">!function(e){function t(t,n){if(!(n in e)){for(var r,a=e.document,i=a.scripts,o=i.length;o--;)if(-1!==i[o].src.indexOf(t)){r=i[o];break}if(!r){r=a.createElement(\"script\"),r.type=\"text\/javascript\",r.async=!0,r.defer=!0,r.src=t,r.charset=\"UTF-8\";var d=function(){var e=a.getElementsByTagName(\"script\")[0];e.parentNode.insertBefore(r,e)};\"[object Opera]\"==e.opera?a.addEventListener?a.addEventListener(\"DOMContentLoaded\",d,!1):e.attachEvent(\"onload\",d):d()}}}t(\"\/\/mediator.mail.ru\/script\/2820404\/\",\"_mediator\")}(window);<\/script>     <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:\/\/habr.com\/ru\/post\/459416\/\"> https:\/\/habr.com\/ru\/post\/459416\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"\n<div class=\"post__text post__text-html js-mediator-article\">\n<blockquote><p><a href=\"https:\/\/habr.com\/ru\/post\/459272\/\">\u041f\u0438\u0448\u0435\u043c API \u0434\u043b\u044f React \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u043e\u0432, \u0447\u0430\u0441\u0442\u044c 1: \u043d\u0435 \u0441\u043e\u0437\u0434\u0430\u0432\u0430\u0439\u0442\u0435 \u043a\u043e\u043d\u0444\u043b\u0438\u043a\u0442\u0443\u044e\u0449\u0438\u0435 \u043f\u0440\u043e\u043f\u0441\u044b<\/a><\/p>\n<p>  <a href=\"https:\/\/habr.com\/ru\/post\/459378\/\">\u041f\u0438\u0448\u0435\u043c API \u0434\u043b\u044f React \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u043e\u0432, \u0447\u0430\u0441\u0442\u044c 2: \u0434\u0430\u0432\u0430\u0439\u0442\u0435 \u043d\u0430\u0437\u0432\u0430\u043d\u0438\u044f \u043f\u043e\u0432\u0435\u0434\u0435\u043d\u0438\u044e, \u0430 \u043d\u0435 \u0441\u043f\u043e\u0441\u043e\u0431\u0430\u043c \u0432\u0437\u0430\u0438\u043c\u043e\u0434\u0435\u0439\u0441\u0442\u0432\u0438\u044f<\/a><\/p>\n<p>  <a href=\"https:\/\/habr.com\/ru\/post\/459380\/\">\u041f\u0438\u0448\u0435\u043c API \u0434\u043b\u044f React \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u043e\u0432, \u0447\u0430\u0441\u0442\u044c 3: \u043f\u043e\u0440\u044f\u0434\u043e\u043a \u043f\u0440\u043e\u043f\u0441\u043e\u0432 \u0432\u0430\u0436\u0435\u043d<\/a><\/p>\n<p>  <a href=\"https:\/\/habr.com\/ru\/post\/459414\/\">\u041f\u0438\u0448\u0435\u043c API \u0434\u043b\u044f React \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u043e\u0432, \u0447\u0430\u0441\u0442\u044c 4: \u043e\u043f\u0430\u0441\u0430\u0439\u0442\u0435\u0441\u044c \u0410\u043f\u0440\u043e\u043f\u0430\u043a\u0430\u043b\u0438\u043f\u0441\u0438\u0441\u0430!<\/a><\/p>\n<p>  <strong>\u041f\u0438\u0448\u0435\u043c API \u0434\u043b\u044f React \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u043e\u0432, \u0447\u0430\u0441\u0442\u044c 5: \u043f\u0440\u043e\u0441\u0442\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0439\u0442\u0435 \u043a\u043e\u043c\u043f\u043e\u0437\u0438\u0446\u0438\u044e<\/strong><\/p><\/blockquote>\n<p>\u0423 \u043d\u0430\u0441 \u0435\u0441\u0442\u044c \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442 \u0437\u043d\u0430\u0447\u043a\u0430:<\/p>\n<p>  <\/p>\n<p><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/6p\/n9\/vq\/6pn9vqzr96ggahurfxzbsi9hm6q.png\" alt=\"badge-1\"><\/p>\n<p>  <\/p>\n<pre><code class=\"xml\">&lt;Badge count={12} \/&gt;<\/code><\/pre>\n<p>  <\/p>\n<p>\u0412\u044b \u0432\u0438\u0434\u0435\u043b\u0438 \u0438\u0445 \u0432 \u0440\u0430\u0437\u043b\u0438\u0447\u043d\u044b\u0445 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f\u0445, \u043e\u043d\u0438 \u043f\u043e\u043a\u0430\u0437\u044b\u0432\u0430\u044e\u0442 \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u043e\u0431\u044a\u0435\u043a\u0442\u043e\u0432 \u0432 \u0432\u0438\u0434\u0435 \u0447\u0438\u0441\u043b\u0430.<\/p>\n<p>  <\/p>\n<p><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/3q\/is\/i1\/3qisi1zoghe30jofkgzpwrtqlpo.png\" alt=\"github-1\"><\/p>\n<p>  <\/p>\n<p>\u0412 <a href=\"https:\/\/github.com\/auth0\/cosmos\">cosmos<\/a> <code>Badge<\/code> (\u0437\u043d\u0430\u0447\u043e\u043a) \u0438\u043c\u0435\u0435\u0442 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0446\u0432\u0435\u0442\u043e\u0432 \u0434\u043b\u044f \u043a\u0430\u0436\u0434\u043e\u0433\u043e \u043a\u043e\u043d\u043a\u0440\u0435\u0442\u043d\u043e\u0433\u043e \u043a\u043e\u043d\u0442\u0435\u043a\u0441\u0442\u0430 (\u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044f, \u043e\u043f\u0430\u0441\u043d\u043e\u0441\u0442\u044c \u0438 \u0442.\u0434.)<\/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-291998","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/291998","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=291998"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/291998\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=291998"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=291998"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=291998"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}