{"id":2347,"date":"2022-01-26T12:10:28","date_gmt":"2022-01-26T12:10:28","guid":{"rendered":"https:\/\/lvboard.infostore.in.ua\/?p=2347"},"modified":"2022-01-26T12:10:28","modified_gmt":"2022-01-26T12:10:28","slug":"5-%d0%bf%d1%80%d0%be%d0%b4%d0%b2%d0%b8%d0%bd%d1%83%d1%82%d1%8b%d1%85-%d1%88%d0%b0%d0%b1%d0%bb%d0%be%d0%bd%d0%be%d0%b2-react-%d0%bd%d0%b0-%d0%bf%d0%b0%d0%bb%d1%8c%d1%86%d0%b0%d1%85","status":"publish","type":"post","link":"https:\/\/lvboard.infostore.in.ua\/?p=2347","title":{"rendered":"5 \u043f\u0440\u043e\u0434\u0432\u0438\u043d\u0443\u0442\u044b\u0445 \u0448\u0430\u0431\u043b\u043e\u043d\u043e\u0432 React \u043d\u0430 \u043f\u0430\u043b\u044c\u0446\u0430\u0445"},"content":{"rendered":"\n<p>\u041a\u0430\u043a \u0438 \u043b\u044e\u0431\u043e\u0439 React-\u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a, \u0432\u044b \u043d\u0430\u0432\u0435\u0440\u043d\u044f\u043a\u0430 \u0437\u0430\u0434\u0430\u0432\u0430\u043b\u0438\u0441\u044c \u043e\u0434\u043d\u0438\u043c \u0438\u0437 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0445 \u0432\u043e\u043f\u0440\u043e\u0441\u043e\u0432:<\/p>\n\n\n\n<!--more-->\n\n\n\n<ul><li>\u041a\u0430\u043a \u0441\u043e\u0437\u0434\u0430\u0442\u044c \u043f\u0435\u0440\u0435\u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c\u044b\u0439 \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442, \u043f\u043e\u0434\u0445\u043e\u0434\u044f\u0449\u0438\u0439 \u0434\u043b\u044f \u0440\u0430\u0437\u043d\u044b\u0445 \u0441\u043b\u0443\u0447\u0430\u0435\u0432?<\/li><li>\u041a\u0430\u043a \u0441\u043e\u0437\u0434\u0430\u0442\u044c \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442 \u0441 \u043f\u0440\u043e\u0441\u0442\u044b\u043c API, \u0443\u043f\u0440\u043e\u0449\u0430\u044e\u0449\u0438\u043c \u0435\u0433\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435?<\/li><li>\u041a\u0430\u043a \u0441\u043e\u0437\u0434\u0430\u0442\u044c \u0440\u0430\u0441\u0448\u0438\u0440\u044f\u0435\u043c\u044b\u0439 \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442 \u0432 \u043f\u043b\u0430\u043d\u0435 UI \u0438 \u0444\u0443\u043d\u043a\u0446\u0438\u043e\u043d\u0430\u043b\u044c\u043d\u043e\u0441\u0442\u0438? &nbsp;<\/li><\/ul>\n\n\n\n<p>\u041f\u043e\u043f\u0443\u043b\u044f\u0440\u043d\u043e\u0441\u0442\u044c \u044d\u0442\u0438\u0445 \u0432\u043e\u043f\u0440\u043e\u0441\u043e\u0432 \u043f\u0440\u0438\u0432\u0435\u043b\u0430 \u043a \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0435 \u0441\u043e\u043e\u0431\u0449\u0435\u0441\u0442\u0432\u043e\u043c React \u043f\u0440\u043e\u0434\u0432\u0438\u043d\u0443\u0442\u044b\u0445 \u0448\u0430\u0431\u043b\u043e\u043d\u043e\u0432.<\/p>\n\n\n\n<p>\u0412 \u0442\u0435\u043a\u0443\u0449\u0435\u0439 \u0441\u0442\u0430\u0442\u044c\u0435 \u044f \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u044e \u043e\u0431\u0437\u043e\u0440 \u043f\u044f\u0442\u0438 \u0442\u0430\u043a\u0438\u0445 \u0448\u0430\u0431\u043b\u043e\u043d\u043e\u0432. \u0410 \u0434\u043b\u044f \u043f\u0440\u043e\u0441\u0442\u043e\u0442\u044b \u0438\u0445 \u0441\u043e\u043f\u043e\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u0438\u044f \u0431\u0443\u0434\u0443 \u0441\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u044c \u0435\u0434\u0438\u043d\u043e\u0439 \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0435 \u0434\u043b\u044f \u043a\u0430\u0436\u0434\u043e\u0433\u043e:<\/p>\n\n\n\n<p>\u0421\u043d\u0430\u0447\u0430\u043b\u0430 \u0431\u0443\u0434\u0435\u0442 \u0438\u0434\u0442\u0438 \u043d\u0435\u0431\u043e\u043b\u044c\u0448\u043e\u0435 \u0432\u0432\u0435\u0434\u0435\u043d\u0438\u0435, \u0441\u043e\u043f\u0440\u043e\u0432\u043e\u0436\u0434\u0430\u0435\u043c\u043e\u0435 \u0440\u0435\u0430\u043b\u044c\u043d\u044b\u043c \u043f\u0440\u0438\u043c\u0435\u0440\u043e\u043c \u043a\u043e\u0434\u0430 (\u043d\u0430 \u043e\u0441\u043d\u043e\u0432\u0435 \u043e\u0434\u043d\u043e\u0433\u043e \u0438 \u0442\u043e\u0433\u043e \u0436\u0435 \u043f\u0440\u043e\u0441\u0442\u043e\u0433\u043e \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u0430 <code>Counter<\/code>).<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img src=\"https:\/\/cdn-images-1.medium.com\/max\/1000\/0*nStZjqrGoXV4a_76.png\" alt=\"\"\/><\/figure>\n\n\n\n<blockquote class=\"wp-block-quote\"><p><em>\u0412\u0435\u0441\u044c \u0438\u0441\u0445\u043e\u0434\u043d\u044b\u0439 \u043a\u043e\u0434 \u0434\u043e\u0441\u0442\u0443\u043f\u0435\u043d \u0432 \u0440\u0435\u043f\u043e\u0437\u0438\u0442\u043e\u0440\u0438\u0438&nbsp;: <\/em><a href=\"https:\/\/github.com\/alex83130\/advanced-react-patterns\" rel=\"noreferrer noopener\" target=\"_blank\"><em>https:\/\/github.com\/alex83130\/advanced-react-patterns<\/em><\/a><em>.<\/em><\/p><\/blockquote>\n\n\n\n<p>\u042f \u0442\u0430\u043a\u0436\u0435 \u0431\u0443\u0434\u0443 \u043f\u0435\u0440\u0435\u0447\u0438\u0441\u043b\u044f\u0442\u044c \u0441\u043f\u0438\u0441\u043e\u043a \u043f\u043b\u044e\u0441\u043e\u0432 \u0438 \u043c\u0438\u043d\u0443\u0441\u043e\u0432, \u0430 \u0437\u0430\u0442\u0435\u043c \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u044f\u0442\u044c \u0434\u0432\u0430 \u0444\u0430\u043a\u0442\u043e\u0440\u0430 \u0432 \u0440\u0430\u0437\u0434\u0435\u043b\u0435 \u201c\u041a\u0440\u0438\u0442\u0435\u0440\u0438\u0438\u201d:<\/p>\n\n\n\n<ul><li><a href=\"https:\/\/kentcdodds.com\/blog\/inversion-of-control\" rel=\"noreferrer noopener\" target=\"_blank\">\u0418\u043d\u0432\u0435\u0440\u0441\u0438\u044f \u0443\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u044f<\/a>: \u0443\u0440\u043e\u0432\u0435\u043d\u044c \u0433\u0438\u0431\u043a\u043e\u0441\u0442\u0438 \u0438 \u043a\u043e\u043d\u0442\u0440\u043e\u043b\u044f, \u043f\u0440\u0435\u0434\u043e\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u043c\u044b\u0439 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f\u043c \u0432\u0430\u0448\u0435\u0433\u043e \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u0430.<\/li><li>\u0421\u043b\u043e\u0436\u043d\u043e\u0441\u0442\u044c \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438: \u0441\u043b\u043e\u0436\u043d\u043e\u0441\u0442\u044c \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u0430 \u043a\u0430\u043a \u0434\u043b\u044f \u0432\u0430\u0441, \u0442\u0430\u043a \u0438 \u0434\u043b\u044f \u0432\u0430\u0448\u0438\u0445 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u0435\u0439.<\/li><\/ul>\n\n\n\n<p>\u0412 \u0437\u0430\u0432\u0435\u0440\u0448\u0435\u043d\u0438\u0438 \u0431\u0443\u0434\u0443\u0442 \u043f\u0440\u0438\u0432\u043e\u0434\u0438\u0442\u0441\u044f \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043f\u0443\u0431\u043b\u0438\u0447\u043d\u044b\u0435 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438, \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e\u0449\u0438\u0435 \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u043d\u044b\u0439 \u0448\u0430\u0431\u043b\u043e\u043d \u0432 \u043f\u0440\u043e\u0434\u0430\u043a\u0448\u043d\u0435.<\/p>\n\n\n\n<blockquote class=\"wp-block-quote\"><p>\u0411\u0443\u0434\u0435\u043c \u0440\u0430\u0441\u0441\u043c\u0430\u0442\u0440\u0438\u0432\u0430\u0442\u044c \u0441\u0438\u0442\u0443\u0430\u0446\u0438\u044e, \u0432 \u043a\u043e\u0442\u043e\u0440\u043e\u0439 React-\u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a \u0441\u043e\u0437\u0434\u0430\u0435\u0442 <code>Component<\/code> \u0434\u043b\u044f \u0434\u0440\u0443\u0433\u0438\u0445 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u043e\u0432. \u0421\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u043d\u043e, \u0434\u0435\u0439\u0441\u0442\u0432\u0443\u044e\u0449\u0435\u0435 \u043b\u0438\u0446\u043e \u201c\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u0438\u201d \u0431\u0443\u0434\u0435\u0442 \u043e\u0442\u043d\u043e\u0441\u0438\u0442\u044c\u0441\u044f \u043d\u0435\u043f\u043e\u0441\u0440\u0435\u0434\u0441\u0442\u0432\u0435\u043d\u043d\u043e \u043a \u044d\u0442\u0438\u043c \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u0430\u043c, \u0430 \u043d\u0435 \u043a\u043e\u043d\u0435\u0447\u043d\u043e\u043c\u0443 \u043f\u043e\u0442\u0440\u0435\u0431\u0438\u0442\u0435\u043b\u044e \u0432\u0430\u0448\u0435\u0433\u043e \u0441\u0430\u0439\u0442\u0430 \u0438\u043b\u0438 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f.<\/p><\/blockquote>\n\n\n\n<h3 id=\"h-1\">1. \u0421\u043e\u0441\u0442\u0430\u0432\u043d\u044b\u0435 \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u044b<\/h3>\n\n\n\n<p>\u042d\u0442\u043e\u0442 \u0448\u0430\u0431\u043b\u043e\u043d \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u0441\u043e\u0437\u0434\u0430\u0432\u0430\u0442\u044c \u0432\u044b\u0440\u0430\u0437\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u0435 \u0438 \u0434\u0435\u043a\u043b\u0430\u0440\u0430\u0442\u0438\u0432\u043d\u044b\u0435 \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u044b \u0431\u0435\u0437 \u0438\u0437\u043b\u0438\u0448\u043d\u0435\u0433\u043e \u043f\u0440\u043e\u0431\u0440\u0430\u0441\u044b\u0432\u0430\u043d\u0438\u044f (<a href=\"https:\/\/kentcdodds.com\/blog\/prop-drilling\" rel=\"noreferrer noopener\" target=\"_blank\">prop drilling<\/a> (\u0430\u043d\u0433\u043b.)). \u041f\u0440\u0438\u043c\u0435\u043d\u0435\u043d\u0438\u0435 \u044d\u0442\u043e\u0433\u043e \u0448\u0430\u0431\u043b\u043e\u043d\u0430 \u0441\u0442\u043e\u0438\u0442 \u0440\u0430\u0441\u0441\u043c\u0430\u0442\u0440\u0438\u0432\u0430\u0442\u044c, \u043a\u043e\u0433\u0434\u0430 \u0442\u0440\u0435\u0431\u0443\u0435\u0442\u0441\u044f \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u0448\u0438\u0440\u043e\u043a\u043e \u043d\u0430\u0441\u0442\u0440\u0430\u0438\u0432\u0430\u0435\u043c\u044b\u0439 \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442 \u0441 \u0431\u043e\u043b\u0435\u0435 \u0447\u0435\u0442\u043a\u0438\u043c \u0440\u0430\u0437\u0434\u0435\u043b\u0435\u043d\u0438\u0435\u043c \u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0435\u043d\u043d\u043e\u0441\u0442\u0438 \u0438 \u043f\u043e\u043d\u044f\u0442\u043d\u044b\u043c API.<\/p>\n\n\n\n<h4 id=\"h-\"><strong>\u041f\u0440\u0438\u043c\u0435\u0440<\/strong><\/h4>\n\n\n\n<p>Github: <a href=\"https:\/\/github.com\/alex83130\/advanced-react-patterns\/tree\/main\/src\/patterns\/compound-component\" rel=\"noreferrer noopener\" target=\"_blank\">https:\/\/github.com\/alex83130\/advanced-react-patterns\/tree\/main\/src\/patterns\/compound-component<\/a><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>import React from \"react\";<br>import { Counter } from \".\/Counter\";<br><br>function Usage() {<br>  const handleChangeCounter = (count) =&gt; {<br>    console.log(\"count\", count);<br>  };<br><br>  return (<br>    &lt;Counter onChange={handleChangeCounter}&gt;<br>      &lt;Counter.Decrement icon=\"minus\" \/&gt;<br>      &lt;Counter.Label&gt;Counter&lt;\/Counter.Label&gt;<br>      &lt;Counter.Count max={10} \/&gt;<br>      &lt;Counter.Increment icon=\"plus\" \/&gt;<br>    &lt;\/Counter&gt;<br>  );<br>}<br><br>export { Usage };<\/code><\/pre>\n\n\n\n<h4 id=\"h--1\"><strong>\u041f\u043b\u044e\u0441\u044b<\/strong><\/h4>\n\n\n\n<ul><li>\u0423\u043c\u0435\u043d\u044c\u0448\u0435\u043d\u0438\u0435 \u0441\u043b\u043e\u0436\u043d\u043e\u0441\u0442\u0438 API: \u0432\u043c\u0435\u0441\u0442\u043e \u0432\u0442\u0438\u0441\u043a\u0438\u0432\u0430\u043d\u0438\u044f \u0432\u0441\u0435\u0445 \u043f\u0440\u043e\u043f\u0441\u043e\u0432 \u0432 \u043e\u0434\u0438\u043d \u0433\u0438\u0433\u0430\u043d\u0442\u0441\u043a\u0438\u0439 \u0440\u043e\u0434\u0438\u0442\u0435\u043b\u044c\u0441\u043a\u0438\u0439 \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442 \u0438 \u0438\u0445 \u043f\u0440\u043e\u0431\u0440\u0430\u0441\u044b\u0432\u0430\u043d\u0438\u044f \u0432\u043d\u0438\u0437 \u043a \u0434\u043e\u0447\u0435\u0440\u043d\u0438\u043c \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u0430\u043c UI \u0437\u0434\u0435\u0441\u044c \u043a\u0430\u0436\u0434\u044b\u0439 \u043f\u0440\u043e\u043f\u0441 \u043f\u0440\u0438\u043a\u0440\u0435\u043f\u043b\u044f\u0435\u0442\u0441\u044f \u043a <code>SubComponent<\/code>, \u0447\u0442\u043e \u043e\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u0442\u0441\u044f \u0431\u043e\u043b\u0435\u0435 \u044d\u0444\u0444\u0435\u043a\u0442\u0438\u0432\u043d\u044b\u043c \u0438 \u0443\u0434\u043e\u0431\u043d\u044b\u043c \u0440\u0435\u0448\u0435\u043d\u0438\u0435\u043c.<\/li><\/ul>\n\n\n\n<figure class=\"wp-block-image\"><img src=\"https:\/\/cdn-images-1.medium.com\/max\/1000\/0*j2tyEfiEWGhQwi72.png\" alt=\"\"\/><\/figure>\n\n\n\n<ul><li>\u0413\u0438\u0431\u043a\u0430\u044f \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0430 \u0440\u0430\u0437\u043c\u0435\u0442\u043a\u0438: \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442 \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u0442 \u043f\u043e\u0432\u044b\u0448\u0435\u043d\u043d\u0443\u044e \u0433\u0438\u0431\u043a\u043e\u0441\u0442\u044c, \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u044e\u0449\u0443\u044e \u0441\u043e\u0437\u0434\u0430\u0432\u0430\u0442\u044c \u043d\u0430 \u0431\u0430\u0437\u0435 \u043e\u0434\u043d\u043e\u0433\u043e \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u0430 \u0440\u0430\u0437\u043b\u0438\u0447\u043d\u044b\u0435 \u0441\u043b\u0443\u0447\u0430\u0438. \u041a \u043f\u0440\u0438\u043c\u0435\u0440\u0443, \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c \u043c\u043e\u0436\u0435\u0442 \u0438\u0437\u043c\u0435\u043d\u0438\u0442\u044c \u043f\u043e\u0440\u044f\u0434\u043e\u043a \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u0438\u0445 <code>SubComponent <\/code>\u0438\u043b\u0438 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0438\u0442\u044c, \u043a\u0430\u043a\u043e\u0439 \u0438\u0437 \u043d\u0438\u0445 \u0434\u043e\u043b\u0436\u0435\u043d \u043e\u0442\u043e\u0431\u0440\u0430\u0436\u0430\u0442\u044c\u0441\u044f.<\/li><\/ul>\n\n\n\n<figure class=\"wp-block-image\"><img src=\"https:\/\/cdn-images-1.medium.com\/max\/1000\/0*d8Ue5vDYdwwNWrjA.png\" alt=\"\"\/><\/figure>\n\n\n\n<ul><li>\u0420\u0430\u0437\u0434\u0435\u043b\u0435\u043d\u0438\u0435 \u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0435\u043d\u043d\u043e\u0441\u0442\u0438: \u0431\u043e\u043b\u044c\u0448\u0430\u044f \u0447\u0430\u0441\u0442\u044c \u043b\u043e\u0433\u0438\u043a\u0438 \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u0442\u0441\u044f \u0432 \u043e\u0441\u043d\u043e\u0432\u043d\u043e\u043c \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u0435 <code>Counter<\/code>, \u0430 <code>React.context<\/code> \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u0434\u043b\u044f \u0440\u0430\u0441\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u044f <code>states<\/code> \u0438 <code>handlers<\/code> \u043f\u043e \u043f\u043e\u0442\u043e\u043c\u043a\u0430\u043c. \u0412 \u0438\u0442\u043e\u0433\u0435 \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u0442\u0441\u044f \u043e\u0442\u0447\u0435\u0442\u043b\u0438\u0432\u043e\u0435 \u0440\u0430\u0437\u0434\u0435\u043b\u0435\u043d\u0438\u0435 \u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0435\u043d\u043d\u043e\u0441\u0442\u0438.<\/li><\/ul>\n\n\n\n<figure class=\"wp-block-image\"><img src=\"https:\/\/cdn-images-1.medium.com\/max\/1000\/0*DjrPQWCE80r6WhyA.png\" alt=\"\"\/><\/figure>\n\n\n\n<h4 id=\"h--2\"><strong>\u041c\u0438\u043d\u0443\u0441\u044b<\/strong><\/h4>\n\n\n\n<ul><li>\u0421\u043b\u0438\u0448\u043a\u043e\u043c \u0432\u044b\u0441\u043e\u043a\u0430\u044f \u0433\u0438\u0431\u043a\u043e\u0441\u0442\u044c: \u043d\u0430\u043b\u0438\u0447\u0438\u0435 \u0433\u0438\u0431\u043a\u043e\u0441\u0442\u0438 \u043f\u043e\u0432\u044b\u0448\u0430\u0435\u0442 \u0432\u0435\u0440\u043e\u044f\u0442\u043d\u043e\u0441\u0442\u044c \u0432\u043e\u0437\u043d\u0438\u043a\u043d\u043e\u0432\u0435\u043d\u0438\u044f \u043d\u0435\u043e\u0436\u0438\u0434\u0430\u043d\u043d\u043e\u0433\u043e \u043f\u043e\u0432\u0435\u0434\u0435\u043d\u0438\u044f (\u0434\u043e\u0431\u0430\u0432\u043b\u0435\u043d\u0438\u0435 \u043d\u0435\u043d\u0443\u0436\u043d\u043e\u0433\u043e \u043f\u043e\u0442\u043e\u043c\u043a\u0430 <code>Component<\/code>, \u043d\u0430\u0440\u0443\u0448\u0435\u043d\u0438\u0435 \u043f\u043e\u0440\u044f\u0434\u043a\u0430 \u043f\u043e\u0442\u043e\u043c\u043a\u043e\u0432 <code>Component<\/code>, \u0437\u0430\u0431\u044b\u0432\u0430\u043d\u0438\u0435 \u0432\u043a\u043b\u044e\u0447\u0438\u0442\u044c \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e\u0433\u043e \u043f\u043e\u0442\u043e\u043c\u043a\u0430).<\/li><\/ul>\n\n\n\n<p>\u0412 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0438 \u043e\u0442 \u0442\u043e\u0433\u043e, \u043a\u0430\u043a\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c \u043f\u043b\u0430\u043d\u0438\u0440\u0443\u0435\u0442\u0441\u044f \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435 \u0432\u0430\u0448\u0435\u0433\u043e \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u0430, \u043f\u043e\u0434\u043e\u0431\u043d\u0430\u044f \u0441\u0442\u0435\u043f\u0435\u043d\u044c \u0433\u0438\u0431\u043a\u043e\u0441\u0442\u0438 \u043c\u043e\u0436\u0435\u0442 \u043e\u043a\u0430\u0437\u0430\u0442\u044c\u0441\u044f \u0438\u0437\u043b\u0438\u0448\u043d\u0435\u0439.<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img src=\"https:\/\/cdn-images-1.medium.com\/max\/1000\/0*Lk6_T677M5bua29I.png\" alt=\"\"\/><\/figure>\n\n\n\n<ul><li>\u0423\u0442\u044f\u0436\u0435\u043b\u0435\u043d\u0438\u0435 JSX: \u043f\u0440\u0438\u043c\u0435\u043d\u0435\u043d\u0438\u0435 \u044d\u0442\u043e\u0433\u043e \u0448\u0430\u0431\u043b\u043e\u043d\u0430 \u0443\u0432\u0435\u043b\u0438\u0447\u0438\u0442 \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u0441\u0442\u0440\u043e\u043a JSX, \u043e\u0441\u043e\u0431\u0435\u043d\u043d\u043e \u0435\u0441\u043b\u0438 \u0432\u044b \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0435 \u043b\u0438\u043d\u0442\u0435\u0440 \u0432\u0440\u043e\u0434\u0435 <code>ESLint<\/code> \u043b\u0438\u0431\u043e \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442 \u0444\u043e\u0440\u043c\u0430\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u043a\u043e\u0434\u0430 \u0432\u0440\u043e\u0434\u0435 <code>Prettier<\/code>. \u0412 \u043c\u0430\u0441\u0448\u0442\u0430\u0431\u0430\u0445 \u043e\u0434\u043d\u043e\u0433\u043e \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u0430 \u044d\u0442\u043e \u043c\u043e\u0436\u0435\u0442 \u0432\u044b\u0433\u043b\u044f\u0434\u0435\u0442\u044c \u043d\u0435\u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0435\u043d\u043d\u044b\u043c, \u043d\u043e \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u043d\u043e \u043e\u043a\u0430\u0436\u0435\u0442\u0441\u044f \u0432\u0430\u0436\u043d\u044b\u043c \u043f\u0440\u0438 \u0440\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0435\u043d\u0438\u0438 \u0431\u043e\u043b\u0435\u0435 \u043e\u0431\u0448\u0438\u0440\u043d\u043e\u0439 \u043a\u0430\u0440\u0442\u0438\u043d\u044b.<\/li><\/ul>\n\n\n\n<figure class=\"wp-block-image\"><img src=\"https:\/\/cdn-images-1.medium.com\/max\/1000\/0*KVzlO9STqclDZOjd.png\" alt=\"\"\/><\/figure>\n\n\n\n<h4 id=\"h--3\"><strong>\u041a\u0440\u0438\u0442\u0435\u0440\u0438\u0438<\/strong>&nbsp;<\/h4>\n\n\n\n<ul><li>\u0418\u043d\u0432\u0435\u0440\u0441\u0438\u044f \u0443\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u044f: 1\/4<\/li><li>\u0421\u043b\u043e\u0436\u043d\u043e\u0441\u0442\u044c \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438: 1\/4<\/li><\/ul>\n\n\n\n<h4 id=\"h--4\"><strong>\u041f\u0443\u0431\u043b\u0438\u0447\u043d\u044b\u0435 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438<\/strong><\/h4>\n\n\n\n<ul><li><a href=\"https:\/\/react-bootstrap.github.io\/components\/dropdowns\/\" rel=\"noreferrer noopener\" target=\"_blank\">React Bootstrap<\/a><\/li><li><a href=\"https:\/\/reach.tech\/accordion\" rel=\"noreferrer noopener\" target=\"_blank\">Reach UI<\/a><\/li><\/ul>\n\n\n\n<h3 id=\"h-2\">2. \u0423\u043f\u0440\u0430\u0432\u043b\u044f\u044e\u0449\u0438\u0435 \u043f\u0440\u043e\u043f\u0441\u044b<\/h3>\n\n\n\n<p>\u042d\u0442\u043e\u0442 \u0448\u0430\u0431\u043b\u043e\u043d \u043f\u0440\u0435\u043e\u0431\u0440\u0430\u0437\u0443\u0435\u0442 \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442 \u0432 <a href=\"https:\/\/reactjs.org\/docs\/forms.html#controlled-components\" rel=\"noreferrer noopener\" target=\"_blank\">\u0443\u043f\u0440\u0430\u0432\u043b\u044f\u0435\u043c\u044b\u0439 \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442<\/a>. \u0412\u043d\u0435\u0448\u043d\u0435\u0435 \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u0435 \u043f\u0440\u0438\u043d\u0438\u043c\u0430\u0435\u0442\u0441\u044f \u0432 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 \u201c\u0435\u0434\u0438\u043d\u043e\u0433\u043e \u0438\u0441\u0442\u043e\u0447\u043d\u0438\u043a\u0430 \u0438\u0441\u0442\u0438\u043d\u044b\u201d, \u0447\u0442\u043e \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044e \u0432\u043d\u0435\u0434\u0440\u044f\u0442\u044c \u0441\u043e\u0431\u0441\u0442\u0432\u0435\u043d\u043d\u0443\u044e \u043b\u043e\u0433\u0438\u043a\u0443, \u0438\u0437\u043c\u0435\u043d\u044f\u044e\u0449\u0443\u044e \u043f\u0440\u0435\u0434\u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043b\u0435\u043d\u043d\u043e\u0435 \u043f\u043e\u0432\u0435\u0434\u0435\u043d\u0438\u0435 \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u0430.<\/p>\n\n\n\n<h4 id=\"h--5\"><strong>\u041f\u0440\u0438\u043c\u0435\u0440<\/strong><\/h4>\n\n\n\n<p>Github: <a href=\"https:\/\/github.com\/alex83130\/advanced-react-patterns\/tree\/main\/src\/patterns\/control-props\" rel=\"noreferrer noopener\" target=\"_blank\">https:\/\/github.com\/alex83130\/advanced-react-patterns\/tree\/main\/src\/patterns\/control-props<\/a><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>import React, { useState } from \"react\";<br>import { Counter } from \".\/Counter\";<br><br>function Usage() {<br>  const &#91;count, setCount] = useState(0);<br><br>  const handleChangeCounter = (newCount) =&gt; {<br>    setCount(newCount);<br>  };<br>  return (<br>    &lt;Counter value={count} onChange={handleChangeCounter}&gt;<br>      &lt;Counter.Decrement icon={\"minus\"} \/&gt;<br>      &lt;Counter.Label&gt;Counter&lt;\/Counter.Label&gt;<br>      &lt;Counter.Count max={10} \/&gt;<br>      &lt;Counter.Increment icon={\"plus\"} \/&gt;<br>    &lt;\/Counter&gt;<br>  );<br>}<br><br>export { Usage };<\/code><\/pre>\n\n\n\n<h4 id=\"h--6\"><strong>\u041f\u043b\u044e\u0441\u044b<\/strong><\/h4>\n\n\n\n<ul><li>\u0414\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u0439 \u043a\u043e\u043d\u0442\u0440\u043e\u043b\u044c: \u043f\u043e\u0441\u043a\u043e\u043b\u044c\u043a\u0443 \u043e\u0441\u043d\u043e\u0432\u043d\u043e\u0435 \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u0435 \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u043e \u0432\u043d\u0435 \u0432\u0430\u0448\u0435\u0433\u043e \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u0430, \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c \u0435\u0433\u043e \u043a\u043e\u043d\u0442\u0440\u043e\u043b\u0438\u0440\u0443\u0435\u0442, \u0430 \u0437\u043d\u0430\u0447\u0438\u0442 \u043c\u043e\u0436\u0435\u0442 \u043d\u0435\u043f\u043e\u0441\u0440\u0435\u0434\u0441\u0442\u0432\u0435\u043d\u043d\u043e \u0432\u043b\u0438\u044f\u0442\u044c \u043d\u0430 \u0441\u0430\u043c \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442.<\/li><\/ul>\n\n\n\n<figure class=\"wp-block-image\"><img src=\"https:\/\/cdn-images-1.medium.com\/max\/1000\/0*C4lqWUa9peLdUHu4.png\" alt=\"\"\/><\/figure>\n\n\n\n<h4 id=\"h--7\"><strong>\u041c\u0438\u043d\u0443\u0441\u044b<\/strong><\/h4>\n\n\n\n<ul><li>\u0421\u043b\u043e\u0436\u043d\u043e\u0441\u0442\u044c \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438: \u0440\u0430\u043d\u0435\u0435 \u043e\u0434\u043d\u043e\u0439 \u0438\u043d\u0442\u0435\u0433\u0440\u0430\u0446\u0438\u0438 \u0432 \u043e\u0434\u043d\u043e\u043c \u043c\u0435\u0441\u0442\u0435 (<code>JSX<\/code>) \u0431\u044b\u043b\u043e \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e, \u0447\u0442\u043e\u0431\u044b \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442 \u0437\u0430\u0440\u0430\u0431\u043e\u0442\u0430\u043b. \u0422\u0435\u043f\u0435\u0440\u044c \u0436\u0435 \u043e\u043d \u0431\u0443\u0434\u0435\u0442 \u0440\u0430\u0437\u0431\u0440\u043e\u0441\u0430\u043d \u043f\u043e \u0442\u0440\u0435\u043c \u0440\u0430\u0437\u043d\u044b\u043c \u0442\u043e\u0447\u043a\u0430\u043c (<code>JSX<\/code> \/ <code>useState<\/code> \/ <code>handleChange<\/code>).<\/li><\/ul>\n\n\n\n<figure class=\"wp-block-image\"><img src=\"https:\/\/cdn-images-1.medium.com\/max\/1000\/0*J8WXpn-kBfRK1iqw.png\" alt=\"\"\/><\/figure>\n\n\n\n<h4 id=\"h--8\"><strong>\u041a\u0440\u0438\u0442\u0435\u0440\u0438\u0438<\/strong><\/h4>\n\n\n\n<ul><li>\u0418\u043d\u0432\u0435\u0440\u0441\u0438\u044f \u0443\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u044f: 2\/4<\/li><li>\u0421\u043b\u043e\u0436\u043d\u043e\u0441\u0442\u044c \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438: 1\/4<\/li><\/ul>\n\n\n\n<h4 id=\"h--9\"><strong>\u041f\u0443\u0431\u043b\u0438\u0447\u043d\u044b\u0435 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438<\/strong><\/h4>\n\n\n\n<ul><li><a href=\"https:\/\/material-ui.com\/components\/rating\/#rating\" rel=\"noreferrer noopener\" target=\"_blank\">Material UI<\/a><\/li><\/ul>\n\n\n\n<h3 id=\"h-3\">3. \u041f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u0441\u043a\u0438\u0439 \u0445\u0443\u043a<\/h3>\n\n\n\n<p>\u041d\u0435\u043c\u043d\u043e\u0433\u043e \u0443\u0433\u043b\u0443\u0431\u0438\u043c\u0441\u044f \u0432 \u201c\u0438\u043d\u0432\u0435\u0440\u0441\u0438\u044e \u0443\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u044f\u201d: \u0442\u0435\u043f\u0435\u0440\u044c \u043e\u0441\u043d\u043e\u0432\u043d\u0430\u044f \u043b\u043e\u0433\u0438\u043a\u0430 \u043f\u0435\u0440\u0435\u0434\u0430\u0435\u0442\u0441\u044f \u0432 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u0441\u043a\u0438\u0439 \u0445\u0443\u043a. \u042d\u0442\u043e\u0442 \u0445\u0443\u043a \u0434\u043e\u0441\u0442\u0443\u043f\u0435\u043d \u0434\u043b\u044f \u0434\u0440\u0443\u0433\u043e\u0433\u043e \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f \u0438 \u0432\u044b\u0440\u0430\u0436\u0430\u0435\u0442 \u0432\u043d\u0443\u0442\u0440\u0435\u043d\u043d\u044e\u044e \u043b\u043e\u0433\u0438\u043a\u0443 (<code>States<\/code>, <code>Handlers<\/code>), \u0434\u0430\u0432\u0430\u044f \u0435\u043c\u0443 \u0440\u0430\u0441\u0448\u0438\u0440\u0435\u043d\u043d\u044b\u0439 \u043a\u043e\u043d\u0442\u0440\u043e\u043b\u044c \u043d\u0430\u0434 \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u043e\u043c.<\/p>\n\n\n\n<h4 id=\"h--10\"><strong>\u041f\u0440\u0438\u043c\u0435\u0440<\/strong><\/h4>\n\n\n\n<p>Github: <a href=\"https:\/\/github.com\/alex83130\/advanced-react-patterns\/tree\/main\/src\/patterns\/custom-hooks\" rel=\"noreferrer noopener\" target=\"_blank\">https:\/\/github.com\/alex83130\/advanced-react-patterns\/tree\/main\/src\/patterns\/custom-hooks<\/a><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>import React from \"react\";<br>import { Counter } from \".\/Counter\";<br>import { useCounter } from \".\/useCounter\";<br><br>function Usage() {<br>  const { count, handleIncrement, handleDecrement } = useCounter(0);<br>  const MAX_COUNT = 10;<br><br>  const handleClickIncrement = () =&gt; {<br>    \/\/\u0420\u0430\u0437\u043c\u0435\u0441\u0442\u0438\u0442\u0435 \u0441\u0432\u043e\u044e \u043b\u043e\u0433\u0438\u043a\u0443 \u0437\u0434\u0435\u0441\u044c<br>    if (count &lt; MAX_COUNT) {<br>      handleIncrement();<br>    }<br>  };<br><br>  return (<br>    &lt;&gt;<br>      &lt;Counter value={count}&gt;<br>        &lt;Counter.Decrement<br>          icon={\"minus\"}<br>          onClick={handleDecrement}<br>          disabled={count === 0}<br>        \/&gt;<br>        &lt;Counter.Label&gt;Counter&lt;\/Counter.Label&gt;<br>        &lt;Counter.Count \/&gt;<br>        &lt;Counter.Increment<br>          icon={\"plus\"}<br>          onClick={handleClickIncrement}<br>          disabled={count === MAX_COUNT}<br>        \/&gt;<br>      &lt;\/Counter&gt;<br>      &lt;button onClick={handleClickIncrement} disabled={count === MAX_COUNT}&gt;<br>        Custom increment btn 1<br>      &lt;\/button&gt;<br>    &lt;\/&gt;<br>  );<br>}<br><br>export { Usage };<\/code><\/pre>\n\n\n\n<h4 id=\"h--11\"><strong>\u041f\u043b\u044e\u0441\u044b<\/strong><\/h4>\n\n\n\n<ul><li>\u0420\u0430\u0441\u0448\u0438\u0440\u0435\u043d\u043d\u044b\u0439 \u043a\u043e\u043d\u0442\u0440\u043e\u043b\u044c: \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c \u043c\u043e\u0436\u0435\u0442 \u0432\u043d\u0435\u0434\u0440\u044f\u0442\u044c \u0441\u043e\u0431\u0441\u0442\u0432\u0435\u043d\u043d\u0443\u044e \u043b\u043e\u0433\u0438\u043a\u0443 \u043c\u0435\u0436\u0434\u0443 \u0445\u0443\u043a\u043e\u043c \u0438 JSX-\u044d\u043b\u0435\u043c\u0435\u043d\u0442\u043e\u043c, \u0447\u0442\u043e \u0434\u0430\u0435\u0442 \u0435\u043c\u0443 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044c \u0438\u0437\u043c\u0435\u043d\u044f\u0442\u044c \u043f\u0440\u0435\u0434\u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043b\u0435\u043d\u043d\u043e\u0435 \u043f\u043e\u0432\u0435\u0434\u0435\u043d\u0438\u0435 \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u0430.<\/li><\/ul>\n\n\n\n<figure class=\"wp-block-image\"><img src=\"https:\/\/cdn-images-1.medium.com\/max\/1000\/0*SChlBtkve2HyZiMj.png\" alt=\"\"\/><\/figure>\n\n\n\n<h4 id=\"h--12\"><strong>\u041c\u0438\u043d\u0443\u0441\u044b<\/strong><\/h4>\n\n\n\n<ul><li>\u0421\u043b\u043e\u0436\u043d\u043e\u0441\u0442\u044c \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438: \u043f\u043e\u0441\u043a\u043e\u043b\u044c\u043a\u0443 \u043b\u043e\u0433\u0438\u0447\u0435\u0441\u043a\u0430\u044f \u0447\u0430\u0441\u0442\u044c \u043e\u0442\u0434\u0435\u043b\u0435\u043d\u0430 \u043e\u0442 \u0447\u0430\u0441\u0442\u0438, \u043e\u0441\u0443\u0449\u0435\u0441\u0442\u0432\u043b\u044f\u044e\u0449\u0435\u0439 \u0440\u0435\u043d\u0434\u0435\u0440\u0438\u043d\u0433, \u0442\u043e \u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0435\u043d\u043d\u043e\u0441\u0442\u044c \u0437\u0430 \u043e\u0440\u0433\u0430\u043d\u0438\u0437\u0430\u0446\u0438\u044e \u0438\u0445 \u0441\u0432\u044f\u0437\u0438 \u043b\u043e\u0436\u0438\u0442\u0441\u044f \u0438\u043c\u0435\u043d\u043d\u043e \u043d\u0430 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f. \u0414\u043b\u044f \u043f\u0440\u0430\u0432\u0438\u043b\u044c\u043d\u043e\u0439 \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 \u0437\u0434\u0435\u0441\u044c \u043f\u043e\u0442\u0440\u0435\u0431\u0443\u0435\u0442\u0441\u044f \u0445\u043e\u0440\u043e\u0448\u0435\u0435 \u043f\u043e\u043d\u0438\u043c\u0430\u043d\u0438\u0435 \u0444\u0443\u043d\u043a\u0446\u0438\u043e\u043d\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u0430.<\/li><\/ul>\n\n\n\n<figure class=\"wp-block-image\"><img src=\"https:\/\/cdn-images-1.medium.com\/max\/1000\/0*csQPf9DOlhr73gJ5.png\" alt=\"\"\/><\/figure>\n\n\n\n<h4 id=\"h--13\"><strong>\u041a\u0440\u0438\u0442\u0435\u0440\u0438\u0439<\/strong><\/h4>\n\n\n\n<ul><li>\u0418\u043d\u0432\u0435\u0440\u0441\u0438\u044f \u0443\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u044f: 2\/4<\/li><li>\u0421\u043b\u043e\u0436\u043d\u043e\u0441\u0442\u044c \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438: 2\/4<\/li><\/ul>\n\n\n\n<h4 id=\"h--14\"><strong>\u041f\u0443\u0431\u043b\u0438\u0447\u043d\u044b\u0435 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438<\/strong><\/h4>\n\n\n\n<ul><li><a href=\"https:\/\/react-table.tanstack.com\/docs\/examples\/basic\" rel=\"noreferrer noopener\" target=\"_blank\">React table<\/a><\/li><li><a href=\"https:\/\/react-hook-form.com\/api\" rel=\"noreferrer noopener\" target=\"_blank\">React hook form<\/a><\/li><\/ul>\n\n\n\n<h3 id=\"h-4\">4. \u0413\u0435\u0442\u0442\u0435\u0440\u044b&nbsp;\u043f\u0440\u043e\u043f\u0441\u043e\u0432&nbsp;<\/h3>\n\n\n\n<p>\u0428\u0430\u0431\u043b\u043e\u043d \u201c\u041f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u0441\u043a\u0438\u0439 \u0445\u0443\u043a\u201d \u0434\u0430\u0435\u0442 \u043f\u043e\u0432\u044b\u0448\u0435\u043d\u043d\u044b\u0439 \u043a\u043e\u043d\u0442\u0440\u043e\u043b\u044c, \u043d\u043e \u0443\u0441\u043b\u043e\u0436\u043d\u044f\u0435\u0442 \u0438\u043d\u0442\u0435\u0433\u0440\u0430\u0446\u0438\u044e \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u043e\u0432, \u0442\u0430\u043a \u043a\u0430\u043a \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044e \u043f\u0440\u0438\u0445\u043e\u0434\u0438\u0442\u0441\u044f \u0438\u043c\u0435\u0442\u044c \u0434\u0435\u043b\u043e \u0441\u043e \u043c\u043d\u043e\u0436\u0435\u0441\u0442\u0432\u043e\u043c \u043d\u0430\u0442\u0438\u0432\u043d\u044b\u0445 \u043f\u0440\u043e\u043f\u0441\u043e\u0432 \u0445\u0443\u043a\u0430 \u0438 \u043f\u043e\u0432\u0442\u043e\u0440\u043d\u043e \u043f\u0440\u043e\u043f\u0438\u0441\u044b\u0432\u0430\u0442\u044c \u043b\u043e\u0433\u0438\u043a\u0443 \u043d\u0430 \u0441\u0432\u043e\u0435\u0439 \u0441\u0442\u043e\u0440\u043e\u043d\u0435. \u0428\u0430\u0431\u043b\u043e\u043d \u201c\u0413\u0435\u0442\u0442\u0435\u0440\u044b \u043f\u0440\u043e\u043f\u0441\u043e\u0432\u201d \u0441\u043a\u0440\u044b\u0432\u0430\u0435\u0442 \u044d\u0442\u0443 \u0441\u043b\u043e\u0436\u043d\u043e\u0441\u0442\u044c. <code>getter<\/code> \u200a\u2014\u200a \u044d\u0442\u043e \u0444\u0443\u043d\u043a\u0446\u0438\u044f, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u0442 \u043c\u043d\u043e\u0433\u043e \u043f\u0440\u043e\u043f\u0441\u043e\u0432. \u041d\u0430\u0437\u0432\u0430\u043d\u0438\u0435 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u0433\u043e\u0432\u043e\u0440\u0438\u0442 \u0441\u0430\u043c\u043e \u0437\u0430 \u0441\u0435\u0431\u044f, \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u044f \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044e \u0435\u0441\u0442\u0435\u0441\u0442\u0432\u0435\u043d\u043d\u044b\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c \u0441\u0432\u044f\u0437\u044b\u0432\u0430\u0442\u044c \u0435\u0435 \u0441 \u043f\u0440\u0430\u0432\u0438\u043b\u044c\u043d\u044b\u043c JSX-\u044d\u043b\u0435\u043c\u0435\u043d\u0442\u043e\u043c.<\/p>\n\n\n\n<h4 id=\"h--15\"><strong>\u041f\u0440\u0438\u043c\u0435\u0440<\/strong><\/h4>\n\n\n\n<p>Github: <a href=\"https:\/\/github.com\/alex83130\/advanced-react-patterns\/tree\/main\/src\/patterns\/props-getters\" rel=\"noreferrer noopener\" target=\"_blank\">https:\/\/github.com\/alex83130\/advanced-react-patterns\/tree\/main\/src\/patterns\/props-getters<\/a><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>import React from \"react\";<br>import { Counter } from \".\/Counter\";<br>import { useCounter } from \".\/useCounter\";<br><br>const MAX_COUNT = 10;<br><br>function Usage() {<br>  const {<br>    count,<br>    getCounterProps,<br>    getIncrementProps,<br>    getDecrementProps<br>  } = useCounter({<br>    initial: 0,<br>    max: MAX_COUNT<br>  });<br><br>  const handleBtn1Clicked = () =&gt; {<br>    console.log(\"btn 1 clicked\");<br>  };<br><br>  return (<br>    &lt;&gt;<br>      &lt;Counter {...getCounterProps()}&gt;<br>        &lt;Counter.Decrement icon={\"minus\"} {...getDecrementProps()} \/&gt;<br>        &lt;Counter.Label&gt;Counter&lt;\/Counter.Label&gt;<br>        &lt;Counter.Count \/&gt;<br>        &lt;Counter.Increment icon={\"plus\"} {...getIncrementProps()} \/&gt;<br>      &lt;\/Counter&gt;<br>      &lt;button {...getIncrementProps({ onClick: handleBtn1Clicked })}&gt;<br>        Custom increment btn 1<br>      &lt;\/button&gt;<br>      &lt;button {...getIncrementProps({ disabled: count &gt; MAX_COUNT - 2 })}&gt;<br>        Custom increment btn 2<br>      &lt;\/button&gt;<br>    &lt;\/&gt;<br>  );<br>}<br><br>export { Usage };<\/code><\/pre>\n\n\n\n<h4 id=\"h--16\"><strong>\u041f\u043b\u044e\u0441\u044b:<\/strong><\/h4>\n\n\n\n<ul><li>\u041f\u0440\u043e\u0441\u0442\u043e\u0442\u0430 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f: \u043f\u0440\u0435\u0434\u043e\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u0442 \u043f\u0440\u043e\u0441\u0442\u043e\u0439 \u0441\u043f\u043e\u0441\u043e\u0431 \u0438\u043d\u0442\u0435\u0433\u0440\u0430\u0446\u0438\u0438 \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u0430. \u0412\u0441\u044f \u0441\u043b\u043e\u0436\u043d\u043e\u0441\u0442\u044c \u0441\u043a\u0440\u044b\u0442\u0430, \u0438 \u043e\u0442 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f \u0442\u0440\u0435\u0431\u0443\u0435\u0442\u0441\u044f \u043b\u0438\u0448\u044c \u0441\u0432\u044f\u0437\u0430\u0442\u044c \u043f\u0440\u0430\u0432\u0438\u043b\u044c\u043d\u043e\u0433\u043e \u0433\u0435\u0442\u0442\u0435\u0440\u0430 \u0441 \u043f\u0440\u0430\u0432\u0438\u043b\u044c\u043d\u044b\u043c JSX-\u044d\u043b\u0435\u043c\u0435\u043d\u0442\u043e\u043c.<\/li><\/ul>\n\n\n\n<figure class=\"wp-block-image\"><img src=\"https:\/\/cdn-images-1.medium.com\/max\/1000\/0*b54-Q8liFXMJlQ7I.png\" alt=\"\"\/><\/figure>\n\n\n\n<ul><li>\u0413\u0438\u0431\u043a\u043e\u0441\u0442\u044c: \u0443 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f \u043f\u043e-\u043f\u0440\u0435\u0436\u043d\u0435\u043c\u0443 \u0441\u043e\u0445\u0440\u0430\u043d\u044f\u0435\u0442\u0441\u044f \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044c \u043f\u0435\u0440\u0435\u0433\u0440\u0443\u0437\u043a\u0438 \u0441\u043e\u0434\u0435\u0440\u0436\u0430\u0449\u0438\u0445\u0441\u044f \u0432 \u0433\u0435\u0442\u0442\u0435\u0440\u0430\u0445 \u043f\u0440\u043e\u043f\u0441\u043e\u0432 \u0434\u043b\u044f \u0430\u0434\u0430\u043f\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u0430 \u043a \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u044b\u043c \u0441\u043b\u0443\u0447\u0430\u044f\u043c.<\/li><\/ul>\n\n\n\n<figure class=\"wp-block-image\"><img src=\"https:\/\/cdn-images-1.medium.com\/max\/1000\/0*AiG_e2jWFNxJg-E8.png\" alt=\"\"\/><\/figure>\n\n\n\n<h4 id=\"h--17\"><strong>\u041c\u0438\u043d\u0443\u0441\u044b<\/strong><\/h4>\n\n\n\n<ul><li>\u041d\u0435\u0434\u043e\u0441\u0442\u0430\u0442\u043e\u043a \u043f\u0440\u043e\u0437\u0440\u0430\u0447\u043d\u043e\u0441\u0442\u0438: \u043f\u0440\u0438\u0432\u043d\u043e\u0441\u0438\u043c\u0430\u044f \u0433\u0435\u0442\u0442\u0435\u0440\u0430\u043c\u0438 \u0430\u0431\u0441\u0442\u0440\u0430\u043a\u0446\u0438\u044f \u0443\u043f\u0440\u043e\u0449\u0430\u0435\u0442 \u0438\u043d\u0442\u0435\u0433\u0440\u0430\u0446\u0438\u044e \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u0430, \u043d\u043e \u0442\u0430\u043a\u0436\u0435 \u0434\u0435\u043b\u0430\u0435\u0442 \u0435\u0433\u043e \u0431\u043e\u043b\u0435\u0435 \u0441\u043a\u0440\u044b\u0442\u044b\u043c \u0438 \u201c\u043c\u0430\u0433\u0438\u0447\u0435\u0441\u043a\u0438\u043c\u201d. \u0427\u0442\u043e\u0431\u044b \u043a\u043e\u0440\u0440\u0435\u043a\u0442\u043d\u043e \u043f\u0435\u0440\u0435\u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0438\u0442\u044c \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044e \u043d\u0443\u0436\u043d\u043e \u0437\u043d\u0430\u0442\u044c \u0441\u043f\u0438\u0441\u043e\u043a \u043f\u0440\u043e\u043f\u0441\u043e\u0432, \u0432\u044b\u0440\u0430\u0436\u0430\u0435\u043c\u044b\u0445 \u0433\u0435\u0442\u0442\u0435\u0440\u0430\u043c\u0438, \u0430 \u0442\u0430\u043a\u0436\u0435 \u043f\u043e\u043d\u0438\u043c\u0430\u0442\u044c, \u043a\u0430\u043a\u043e\u0435 \u0432\u043b\u0438\u044f\u043d\u0438\u0435 \u043d\u0430 \u0432\u043d\u0443\u0442\u0440\u0435\u043d\u043d\u044e\u044e \u043b\u043e\u0433\u0438\u043a\u0443 \u043e\u043a\u0430\u0436\u0435\u0442 \u0438\u0445 \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u0435.<\/li><\/ul>\n\n\n\n<h4 id=\"h--18\"><strong>\u041a\u0440\u0438\u0442\u0435\u0440\u0438\u0438<\/strong><\/h4>\n\n\n\n<ul><li>\u0418\u043d\u0432\u0435\u0440\u0441\u0438\u044f \u0443\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u044f: 3\/4<\/li><li>\u0421\u043b\u043e\u0436\u043d\u043e\u0441\u0442\u044c \u0438\u043d\u0442\u0435\u0433\u0440\u0430\u0446\u0438\u0438: 3\/4<\/li><\/ul>\n\n\n\n<h4 id=\"h--19\"><strong>\u041f\u0443\u0431\u043b\u0438\u0447\u043d\u044b\u0435 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438<\/strong><\/h4>\n\n\n\n<ul><li><a href=\"https:\/\/react-table.tanstack.com\/docs\/examples\/basic\" rel=\"noreferrer noopener\" target=\"_blank\">React table<\/a><\/li><li><a href=\"https:\/\/github.com\/downshift-js\/downshift#usage\" rel=\"noreferrer noopener\" target=\"_blank\">Downshift<\/a><\/li><\/ul>\n\n\n\n<h3 id=\"h-5\">5. \u0420\u0435\u0434\u044c\u044e\u0441\u0435\u0440 \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u044f<\/h3>\n\n\n\n<p>\u0421\u0430\u043c\u044b\u0439 \u043f\u0440\u043e\u0434\u0432\u0438\u043d\u0443\u0442\u044b\u0439 \u0448\u0430\u0431\u043b\u043e\u043d \u0432 \u043f\u043b\u0430\u043d\u0435 \u0438\u043d\u0432\u0435\u0440\u0441\u0438\u0438 \u0443\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u044f. \u041e\u043d \u043f\u0440\u0435\u0434\u043e\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u0442 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044e \u0431\u043e\u043b\u0435\u0435 \u0443\u0434\u043e\u0431\u043d\u044b\u0439 \u0441\u043f\u043e\u0441\u043e\u0431 \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u044f \u0432\u043d\u0443\u0442\u0440\u0435\u043d\u043d\u0435\u0433\u043e \u0444\u0443\u043d\u043a\u0446\u0438\u043e\u043d\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u0430. \u0415\u0433\u043e \u043a\u043e\u0434 \u0430\u043d\u0430\u043b\u043e\u0433\u0438\u0447\u0435\u043d \u0448\u0430\u0431\u043b\u043e\u043d\u0443 \u201c\u041f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u0441\u043a\u0438\u0439 \u0445\u0443\u043a\u201d, \u043d\u043e \u0437\u0434\u0435\u0441\u044c \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c \u0442\u0430\u043a\u0436\u0435 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u044f\u0435\u0442 <code>reducer<\/code>, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043f\u0435\u0440\u0435\u0434\u0430\u0435\u0442\u0441\u044f \u0432 \u0445\u0443\u043a. \u042d\u0442\u043e\u0442 <code>reducer<\/code> \u0431\u0443\u0434\u0435\u0442 \u043f\u0435\u0440\u0435\u0433\u0440\u0443\u0436\u0430\u0442\u044c \u043b\u044e\u0431\u043e\u0435 \u0432\u043d\u0443\u0442\u0440\u0435\u043d\u043d\u0435\u0435 \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u0435 \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u0430.&nbsp;<\/p>\n\n\n\n<h4 id=\"h--20\"><strong>\u041f\u0440\u0438\u043c\u0435\u0440<\/strong><\/h4>\n\n\n\n<p>Github: <a href=\"https:\/\/github.com\/alex83130\/advanced-react-patterns\/tree\/main\/src\/patterns\/state-reducer\" rel=\"noreferrer noopener\" target=\"_blank\">https:\/\/github.com\/alex83130\/advanced-react-patterns\/tree\/main\/src\/patterns\/state-reducer<\/a><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>import React from \"react\";<br>import { Counter } from \".\/Counter\";<br>import { useCounter } from \".\/useCounter\";<br><br>const MAX_COUNT = 10;<br>function Usage() {<br>  const reducer = (state, action) =&gt; {<br>    switch (action.type) {<br>      case \"decrement\":<br>        return {<br>          count: Math.max(0, state.count - 2) \/\/The decrement delta was changed for 2 (Default is 1)<br>        };<br>      default:<br>        return useCounter.reducer(state, action);<br>    }<br>  };<br><br>  const { count, handleDecrement, handleIncrement } = useCounter(<br>    { initial: 0, max: 10 },<br>    reducer<br>  );<br><br>  return (<br>    &lt;&gt;<br>      &lt;Counter value={count}&gt;<br>        &lt;Counter.Decrement icon={\"minus\"} onClick={handleDecrement} \/&gt;<br>        &lt;Counter.Label&gt;Counter&lt;\/Counter.Label&gt;<br>        &lt;Counter.Count \/&gt;<br>        &lt;Counter.Increment icon={\"plus\"} onClick={handleIncrement} \/&gt;<br>      &lt;\/Counter&gt;<br>      &lt;button onClick={handleIncrement} disabled={count === MAX_COUNT}&gt;<br>        Custom increment btn 1<br>      &lt;\/button&gt;<br>    &lt;\/&gt;<br>  );<br>}<br><br>export { Usage };<\/code><\/pre>\n\n\n\n<blockquote class=\"wp-block-quote\"><p>\u0412 \u044d\u0442\u043e\u043c \u043f\u0440\u0438\u043c\u0435\u0440\u0435 \u043c\u044b \u0441\u043e\u043f\u043e\u0441\u0442\u0430\u0432\u0438\u043b\u0438 \u0448\u0430\u0431\u043b\u043e\u043d \u201c\u0420\u0435\u0434\u044c\u044e\u0441\u0435\u0440 \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u044f\u201d \u0441 \u201c\u041f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u0441\u043a\u0438\u043c \u0445\u0443\u043a\u043e\u043c\u201d, \u043d\u043e \u0435\u0433\u043e \u0442\u0430\u043a\u0436\u0435 \u043c\u043e\u0436\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0441 \u0448\u0430\u0431\u043b\u043e\u043d\u043e\u043c \u201c\u0421\u043e\u0441\u0442\u0430\u0432\u043d\u044b\u0435 \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u044b\u201d \u0438 \u043f\u0435\u0440\u0435\u0434\u0430\u0432\u0430\u0442\u044c <code>reducer<\/code> \u043d\u0430\u043f\u0440\u044f\u043c\u0443\u044e \u0432 \u043e\u0441\u043d\u043e\u0432\u043d\u043e\u0439 \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442 <code>Counter<\/code>.<\/p><\/blockquote>\n\n\n\n<h4 id=\"h--21\"><strong>\u041f\u043b\u044e\u0441\u044b<\/strong>&nbsp;<\/h4>\n\n\n\n<ul><li>\u0420\u0430\u0441\u0448\u0438\u0440\u0435\u043d\u043d\u044b\u0439 \u043a\u043e\u043d\u0442\u0440\u043e\u043b\u044c: \u0432 \u043d\u0430\u0438\u0431\u043e\u043b\u0435\u0435 \u0441\u043b\u043e\u0436\u043d\u044b\u0445 \u0441\u043b\u0443\u0447\u0430\u044f\u0445 \u043f\u0440\u0438\u043c\u0435\u043d\u0435\u043d\u0438\u0435 \u0440\u0435\u0434\u044c\u044e\u0441\u0435\u0440\u043e\u0432 \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u044f \u043e\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u0442\u0441\u044f \u043e\u043f\u0442\u0438\u043c\u0430\u043b\u044c\u043d\u044b\u043c \u0441\u043f\u043e\u0441\u043e\u0431\u043e\u043c \u043f\u0440\u0435\u0434\u043e\u0441\u0442\u0430\u0432\u0438\u0442\u044c \u0443\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u0435 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044e. \u0412\u0441\u0435 \u0432\u043d\u0443\u0442\u0440\u0435\u043d\u043d\u0438\u0435 \u044d\u043a\u0448\u0435\u043d\u044b \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u0430 \u0442\u0435\u043f\u0435\u0440\u044c \u0441\u0442\u0430\u043d\u043e\u0432\u044f\u0442\u0441\u044f \u0434\u043e\u0441\u0442\u0443\u043f\u043d\u044b \u0438\u0437\u0432\u043d\u0435 \u0438 \u043c\u043e\u0433\u0443\u0442 \u0431\u044b\u0442\u044c \u043f\u0435\u0440\u0435\u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u044b.<\/li><\/ul>\n\n\n\n<figure class=\"wp-block-image\"><img src=\"https:\/\/cdn-images-1.medium.com\/max\/1000\/0*WnoSK-Bi_CVE8Fqd.png\" alt=\"\"\/><\/figure>\n\n\n\n<h4 id=\"h--22\"><strong>\u041c\u0438\u043d\u0443\u0441\u044b:<\/strong><\/h4>\n\n\n\n<ul><li>\u0421\u043b\u043e\u0436\u043d\u043e\u0441\u0442\u044c \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438: \u044d\u0442\u043e \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u043d\u043e \u043d\u0430\u0438\u0431\u043e\u043b\u0435\u0435 \u0441\u043b\u043e\u0436\u043d\u044b\u0439 \u0432 \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 \u0448\u0430\u0431\u043b\u043e\u043d \u043a\u0430\u043a \u0434\u043b\u044f \u0432\u0430\u0441, \u0442\u0430\u043a \u0438 \u0434\u043b\u044f \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f.<\/li><li>\u041d\u0435\u0434\u043e\u0441\u0442\u0430\u0442\u043e\u043a \u043f\u0440\u043e\u0437\u0440\u0430\u0447\u043d\u043e\u0441\u0442\u0438: \u043f\u043e\u0441\u043a\u043e\u043b\u044c\u043a\u0443 \u043b\u044e\u0431\u043e\u0439 \u044d\u043a\u0448\u0435\u043d \u0440\u0435\u0434\u044c\u044e\u0441\u0435\u0440\u0430 \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c \u0438\u0437\u043c\u0435\u043d\u0435\u043d, \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u0445\u043e\u0440\u043e\u0448\u0435\u0435 \u043f\u043e\u043d\u0438\u043c\u0430\u043d\u0438\u0435 \u0432\u043d\u0443\u0442\u0440\u0435\u043d\u043d\u0435\u0439 \u043b\u043e\u0433\u0438\u043a\u0438 \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u0430.<\/li><\/ul>\n\n\n\n<h4 id=\"h--23\"><strong>\u041a\u0440\u0438\u0442\u0435\u0440\u0438\u0438<\/strong><\/h4>\n\n\n\n<ul><li>\u0418\u043d\u0432\u0435\u0440\u0441\u0438\u044f \u0443\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u044f: 4\/4<\/li><li>\u0421\u043b\u043e\u0436\u043d\u043e\u0441\u0442\u044c \u0438\u043d\u0442\u0435\u0433\u0440\u0430\u0446\u0438\u0438: 4\/4<\/li><\/ul>\n\n\n\n<h4 id=\"h--24\"><strong>\u041f\u0443\u0431\u043b\u0438\u0447\u043d\u044b\u0435 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438<\/strong><\/h4>\n\n\n\n<ul><li><a href=\"https:\/\/github.com\/downshift-js\/downshift#statereducer\" rel=\"noreferrer noopener\" target=\"_blank\">Downshift<\/a><\/li><\/ul>\n\n\n\n<h3 id=\"h--25\">\u0417\u0430\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435<\/h3>\n\n\n\n<p>\u0420\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0435\u0432 5 \u043f\u0440\u043e\u0434\u0432\u0438\u043d\u0443\u0442\u044b\u0445 \u0448\u0430\u0431\u043b\u043e\u043d\u043e\u0432 React, \u043c\u044b \u0443\u0437\u043d\u0430\u043b\u0438 \u0440\u0430\u0437\u043b\u0438\u0447\u043d\u044b\u0435 \u0441\u043f\u043e\u0441\u043e\u0431\u044b \u044d\u0444\u0444\u0435\u043a\u0442\u0438\u0432\u043d\u043e\u0433\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f \u043f\u0440\u0438\u043d\u0446\u0438\u043f\u0430 \u201c\u0438\u043d\u0432\u0435\u0440\u0441\u0438\u0438 \u0443\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u044f\u201d. \u0412\u0441\u0435 \u044d\u0442\u0438 \u0448\u0430\u0431\u043b\u043e\u043d\u044b \u0434\u0430\u044e\u0442 \u0432\u0430\u043c \u0448\u0438\u0440\u043e\u043a\u0438\u0435 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u0438 \u0434\u043b\u044f \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f \u0433\u0438\u0431\u043a\u0438\u0445 \u0438 \u0430\u0434\u0430\u043f\u0442\u0438\u0440\u0443\u0435\u043c\u044b\u0445 \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u043e\u0432.<\/p>\n\n\n\n<p>\u041e\u0434\u043d\u0430\u043a\u043e \u0437\u0434\u0435\u0441\u044c \u0441\u0442\u043e\u0438\u0442 \u0443\u0447\u0435\u0441\u0442\u044c, \u0447\u0442\u043e \u0431\u043e\u043b\u0435\u0435 \u043e\u0431\u0448\u0438\u0440\u043d\u044b\u0435 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u0438 \u0442\u0440\u0435\u0431\u0443\u044e\u0442 \u043f\u043e\u0432\u044b\u0448\u0435\u043d\u043d\u043e\u0439 \u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0435\u043d\u043d\u043e\u0441\u0442\u0438. \u0427\u0435\u043c \u0431\u043e\u043b\u044c\u0448\u0435 \u0432\u044b \u043f\u0435\u0440\u0435\u0434\u0430\u0435\u0442\u0435 \u043a\u043e\u043d\u0442\u0440\u043e\u043b\u044c \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044e, \u0442\u0435\u043c \u0431\u043e\u043b\u044c\u0448\u0435 \u0432\u0430\u0448 \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442 \u0443\u0445\u043e\u0434\u0438\u0442 \u0438\u0437 \u0440\u0430\u0437\u0440\u044f\u0434\u0430 \u201cplug and play\u201d. \u0418\u043c\u0435\u043d\u043d\u043e \u043d\u0430 \u0432\u0430\u0441, \u043a\u0430\u043a \u043d\u0430 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u0435, \u043b\u0435\u0436\u0438\u0442 \u0431\u0440\u0435\u043c\u044f \u0432\u044b\u0431\u043e\u0440\u0430 \u043a\u043e\u0440\u0440\u0435\u043a\u0442\u043d\u043e\u0433\u043e \u0448\u0430\u0431\u043b\u043e\u043d\u0430, \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u044e\u0449\u0435\u0433\u043e \u043a\u043e\u043d\u043a\u0440\u0435\u0442\u043d\u044b\u043c \u043d\u0443\u0436\u0434\u0430\u043c.<\/p>\n\n\n\n<p>\u0412 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 \u043f\u0440\u043e\u0441\u0442\u043e\u0439 \u0448\u043f\u0430\u0440\u0433\u0430\u043b\u043a\u0438 \u044f \u043f\u0440\u0435\u0434\u043e\u0441\u0442\u0430\u0432\u043b\u044e \u0432\u0430\u043c \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0443\u044e \u0441\u0445\u0435\u043c\u0443, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u043a\u043b\u0430\u0441\u0441\u0438\u0444\u0438\u0446\u0438\u0440\u0443\u0435\u0442 \u0448\u0430\u0431\u043b\u043e\u043d\u044b \u043f\u043e \u0434\u0432\u0443\u043c \u0444\u0430\u043a\u0442\u043e\u0440\u0430\u043c: \u201c\u0421\u043b\u043e\u0436\u043d\u043e\u0441\u0442\u044c \u0438\u043d\u0442\u0435\u0433\u0440\u0430\u0446\u0438\u0438\u201d \u0438 \u201c\u0418\u043d\u0432\u0435\u0440\u0441\u0438\u044f \u0443\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u044f\u201d:<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img src=\"https:\/\/cdn-images-1.medium.com\/max\/1000\/0*B527QVGyDmAjBT_T.png\" alt=\"\"\/><\/figure>\n\n\n\n<p>\u0421\u0442\u0430\u0442\u044c\u044f \u043e\u0441\u043d\u043e\u0432\u0430\u043d\u0430 \u043d\u0430 \u0443\u0434\u0438\u0432\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0439 \u0440\u0430\u0431\u043e\u0442\u0435 \u041a\u0435\u043d\u0442\u0430 \u041a. \u0414\u043e\u0434\u0434\u0441\u0430. \u0412 \u0435\u0433\u043e <a href=\"https:\/\/kentcdodds.com\/blog\/\" rel=\"noreferrer noopener\" target=\"_blank\">\u0431\u043b\u043e\u0433\u0435 <\/a>(\u0430\u043d\u0433\u043b.) \u0432\u044b \u043c\u043e\u0436\u0435\u0442\u0435 \u0431\u043e\u043b\u0435\u0435 \u0443\u0433\u043b\u0443\u0431\u043b\u0435\u043d\u043d\u043e \u043f\u043e\u0437\u043d\u0430\u043a\u043e\u043c\u0438\u0442\u044c\u0441\u044f \u0441 \u043a\u0430\u0436\u0434\u044b\u043c \u0438\u0437 \u0440\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0435\u043d\u043d\u044b\u0445 \u0448\u0430\u0431\u043b\u043e\u043d\u043e\u0432.&nbsp;<\/p>\n\n\n\n<p>\u0421\u043f\u0430\u0441\u0438\u0431\u043e \u0437\u0430 \u0447\u0442\u0435\u043d\u0438\u0435!<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u041a\u0430\u043a \u0438 \u043b\u044e\u0431\u043e\u0439 React-\u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a, \u0432\u044b \u043d\u0430\u0432\u0435\u0440\u043d\u044f\u043a\u0430 \u0437\u0430\u0434\u0430\u0432\u0430\u043b\u0438\u0441\u044c \u043e\u0434\u043d\u0438\u043c \u0438\u0437 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0445 \u0432\u043e\u043f\u0440\u043e\u0441\u043e\u0432:<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":[],"categories":[30],"tags":[65],"_links":{"self":[{"href":"https:\/\/lvboard.infostore.in.ua\/index.php?rest_route=\/wp\/v2\/posts\/2347"}],"collection":[{"href":"https:\/\/lvboard.infostore.in.ua\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/lvboard.infostore.in.ua\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/lvboard.infostore.in.ua\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/lvboard.infostore.in.ua\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=2347"}],"version-history":[{"count":1,"href":"https:\/\/lvboard.infostore.in.ua\/index.php?rest_route=\/wp\/v2\/posts\/2347\/revisions"}],"predecessor-version":[{"id":2348,"href":"https:\/\/lvboard.infostore.in.ua\/index.php?rest_route=\/wp\/v2\/posts\/2347\/revisions\/2348"}],"wp:attachment":[{"href":"https:\/\/lvboard.infostore.in.ua\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=2347"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/lvboard.infostore.in.ua\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=2347"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/lvboard.infostore.in.ua\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=2347"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}