{"id":295792,"date":"2019-12-17T16:27:35","date_gmt":"2019-12-17T16:27:35","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=295792"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=295792","title":{"rendered":"\u0423\u043d\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u044f \u0432\u0438\u0437\u0443\u0430\u043b\u044c\u043d\u044b\u0445 \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u043e\u0432. \u0427\u0430\u0441\u0442\u044c 1. \u0421\u0442\u0438\u043b\u0438"},"content":{"rendered":"\n<div class=\"post__text post__text-html js-mediator-article\" id=\"post-content-body\" data-io-article-url=\"https:\/\/habr.com\/ru\/post\/479714\/\"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/00\/7v\/55\/007v55-c7k0gjfzqkhtoy0irbma.png\"\/><\/p>\n<p>  \u0414\u0430\u043d\u043d\u0430\u044f \u0441\u0442\u0430\u0442\u044c\u044f \u0431\u0443\u0434\u0435\u0442, \u043f\u0440\u0435\u0436\u0434\u0435 \u0432\u0441\u0435\u0433\u043e, \u043f\u043e\u043b\u0435\u0437\u043d\u0430 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u0430\u043c, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043d\u0435 \u0440\u0430\u0431\u043e\u0442\u0430\u044e\u0442 \u0441 \u0433\u043e\u0442\u043e\u0432\u044b\u043c\u0438 \u043d\u0430\u0431\u043e\u0440\u0430\u043c\u0438 \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u043e\u0432, \u0442\u0430\u043a\u0438\u043c\u0438 \u043a\u0430\u043a, material-ui, \u0430 \u0440\u0435\u0430\u043b\u0438\u0437\u0443\u044e\u0442 \u0441\u0432\u043e\u0438. \u041d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u0434\u043b\u044f \u043f\u0440\u043e\u0434\u0443\u043a\u0442\u0430 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0430\u043d \u0434\u0438\u0437\u0430\u0439\u043d, \u043e\u0442\u0440\u0430\u0436\u0430\u044e\u0449\u0438\u0439 \u0442\u043e, \u043a\u0430\u043a \u0434\u043e\u043b\u0436\u043d\u044b \u0432\u044b\u0433\u043b\u044f\u0434\u0435\u0442\u044c \u043a\u043d\u043e\u043f\u043e\u0447\u043a\u0438, \u043c\u043e\u0434\u0430\u043b\u044c\u043d\u044b\u0435 \u043e\u043a\u043d\u0430 \u0438 \u0442.\u043f. \u0427\u0442\u043e\u0431\u044b \u0433\u0440\u0430\u043c\u043e\u0442\u043d\u043e \u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u0442\u044c \u0442\u0430\u043a\u0443\u044e \u0434\u0438\u0437\u0430\u0439\u043d-\u0441\u0438\u0441\u0442\u0435\u043c\u0443, \u043f\u043e\u0442\u0440\u0435\u0431\u0443\u0435\u0442\u0441\u044f \u0432\u0441\u0435\u043c \u0435\u0451 \u0430\u0442\u043e\u043c\u0430\u043c \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u0442\u044c \u0445\u043e\u0440\u043e\u0448\u0443\u044e \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u043a\u0443 \u0438\u0445 \u043a\u043e\u043c\u043f\u043e\u0437\u0438\u0446\u0438\u0438. \u0418\u043d\u044b\u043c\u0438 \u0441\u043b\u043e\u0432\u0430\u043c\u0438, \u043d\u0443\u0436\u043d\u043e \u0434\u043e\u0431\u0438\u0442\u044c\u0441\u044f \u0442\u043e\u0433\u043e, \u0447\u0442\u043e\u0431\u044b \u043b\u044e\u0431\u043e\u0439 \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u043e \u0432\u0437\u044f\u0442\u044b\u0439 \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442 \u043c\u043e\u0433 \u0438\u043d\u0442\u0435\u0433\u0440\u0438\u0440\u043e\u0432\u0430\u0442\u044c\u0441\u044f \u0438 \u0438\u0434\u0435\u0430\u043b\u044c\u043d\u043e \u0432\u043f\u0438\u0441\u044b\u0432\u0430\u0442\u044c\u0441\u044f \u0432 \u0431\u043e\u043b\u044c\u0448\u0438\u0439 \u0441\u043e\u0441\u0442\u0430\u0432\u043d\u043e\u0439 \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442. \u0410 \u0435\u0441\u043b\u0438 \u043e\u043d \u043d\u0435 \u0432\u043f\u0438\u0441\u044b\u0432\u0430\u0435\u0442\u0441\u044f, \u0442\u043e \u0431\u044b\u043b\u043e \u0431\u044b \u043d\u0435\u043f\u043b\u043e\u0445\u043e \u0438\u043c\u0435\u0442\u044c \u043f\u0440\u043e\u0441\u0442\u0443\u044e \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u043a\u0443 \u0435\u0433\u043e \u043a\u0430\u0441\u0442\u043e\u043c\u0438\u0437\u0430\u0446\u0438\u0438. \u041a\u0430\u043a \u0431\u044b \u0442\u043e \u043d\u0438 \u0431\u044b\u043b\u043e, \u044d\u0442\u043e \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u0430\u044f \u0431\u043e\u043b\u044c\u0448\u0430\u044f \u0442\u0435\u043c\u0430, \u0438, \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e, \u044f \u0432\u0435\u0440\u043d\u0443\u0441\u044c \u043a \u043d\u0435\u0439 \u0432 \u0434\u0440\u0443\u0433\u043e\u0439 \u0440\u0430\u0437.<br \/>  <a name=\"habracut\"><\/a>  <\/p>\n<h3>\u041b\u0438\u0440\u0438\u043a\u0430<\/h3>\n<p>  \u0412\u0441\u0435\u043c \u043f\u0440\u0438\u0432\u0435\u0442. \u041d\u0430\u0447\u0438\u043d\u0430\u044e \u0441\u0432\u043e\u0439 \u043f\u0443\u0442\u044c \u043d\u0430 \u0445\u0430\u0431\u0440\u0435 \u0441 \u043f\u0440\u043e\u0441\u0442\u043e\u0439, \u043d\u043e \u043f\u043e\u043b\u0435\u0437\u043d\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0438. \u041a\u0430\u043a \u0434\u043b\u044f \u043c\u0435\u043d\u044f, \u043f\u043e\u043b\u0443\u0447\u0438\u043b\u043e\u0441\u044c \u0441\u043b\u0438\u0448\u043a\u043e\u043c \u043f\u043e\u0434\u0440\u043e\u0431\u043d\u043e, \u043d\u043e \u0432\u0441\u0451 \u0436\u0435 \u044f \u043f\u044b\u0442\u0430\u043b\u0441\u044f \u043f\u043e\u0434\u0441\u0442\u0440\u043e\u0438\u0442\u044c\u0441\u044f \u043f\u043e\u0434 \u0447\u0438\u0442\u0430\u0442\u0435\u043b\u044f, \u0430 \u043d\u0435 \u043f\u043e\u0434 \u0441\u0435\u0431\u044f. \u041f\u0435\u0440\u0435\u0434 \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u0438\u0435\u043c \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u0439 \u0441\u0442\u0430\u0442\u044c\u0438 (\u0435\u0441\u043b\u0438 \u043e\u043d\u0430 \u0431\u0443\u0434\u0435\u0442) \u043d\u0430 \u0431\u043e\u043b\u0435\u0435 \u0441\u043b\u043e\u0436\u043d\u0443\u044e \u0442\u0435\u043c\u0443, \u0438\u043c\u0435\u044e \u0436\u0435\u043b\u0430\u043d\u0438\u0435 \u0441\u043a\u043e\u0440\u0440\u0435\u043a\u0442\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0441\u0432\u043e\u0451 \u0438\u0437\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u043f\u043e \u0444\u0438\u0434\u0431\u044d\u043a\u0443 (\u0435\u0441\u043b\u0438 \u043e\u043d \u0431\u0443\u0434\u0435\u0442).<\/p>\n<p>  \u0418\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c\u044b\u0435 \u0442\u0435\u0440\u043c\u0438\u043d\u044b:<\/p>\n<ul>\n<li> \u0412\u0438\u0437\u0443\u0430\u043b\u044c\u043d\u044b\u0439 \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442 \u2014 \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u0442 \u044d\u043b\u0435\u043c\u0435\u043d\u0442, \u0432\u0441\u0442\u0440\u0430\u0438\u0432\u0430\u044e\u0449\u0438\u0435\u0441\u044f \u0432 DOM. \u041d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, <code>return (&lt;div \/&gt;)<\/code>. \u041a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u0442 \u0442\u043e\u043b\u044c\u043a\u043e \u0434\u0440\u0443\u0433\u043e\u0439 \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442, \u0432\u0438\u0437\u0443\u0430\u043b\u044c\u043d\u044b\u043c \u0442\u0440\u0430\u043a\u0442\u043e\u0432\u0430\u0442\u044c \u043d\u0435 \u0441\u043b\u0435\u0434\u0443\u0435\u0442.<\/li>\n<\/ul>\n<p>  <\/p>\n<h3>\u0412\u0432\u0435\u0434\u0435\u043d\u0438\u0435<\/h3>\n<p>  \u041a\u043e\u0433\u0434\u0430 \u0432\u044b \u0440\u0430\u0437\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u0435\u0442\u0435 \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442, \u0432\u044b \u043d\u0435 \u043c\u043e\u0436\u0435\u0442\u0435 \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u0435\u0433\u043e \u043f\u043e\u043b\u043d\u043e\u0441\u0442\u044c\u044e \u0443\u043d\u0438\u0432\u0435\u0440\u0441\u0430\u043b\u044c\u043d\u044b\u043c. \u0412 \u0433\u043e\u043b\u043e\u0432\u0435 \u0432\u044b \u0432\u0441\u0435\u0433\u0434\u0430 \u043e\u0442\u0442\u0430\u043b\u043a\u0438\u0432\u0430\u0435\u0442\u0435\u0441\u044c \u043e\u0442 \u043a\u043e\u043d\u043a\u0440\u0435\u0442\u043d\u044b\u0445 \u0432\u0430\u0440\u0438\u0430\u043d\u0442\u043e\u0432 \u0435\u0433\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f. \u0427\u0430\u0441\u0442\u043e \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u0442\u0441\u044f, \u0447\u0442\u043e \u043f\u043e\u0441\u043b\u0435 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0438, \u0432\u0430\u0448\u0438 \u043a\u043e\u043b\u043b\u0435\u0433\u0438 \u043d\u0430\u0447\u0438\u043d\u0430\u044e\u0442 \u00ab\u043f\u0438\u0445\u0430\u0442\u044c \u044d\u0442\u043e\u0442 \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442 \u043a\u0443\u0434\u0430 \u043f\u043e\u043f\u0430\u043b\u043e\u00bb. \u0412\u044b \u043d\u0430 \u043d\u0438\u0445 \u0441\u0435\u0440\u0434\u0438\u0442\u0435\u0441\u044c: \u00ab\u041d\u0443 \u044f \u0436\u0435 \u0440\u0430\u0437\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u043b \u0435\u0433\u043e \u043d\u0435 \u0434\u043b\u044f \u044d\u0442\u043e\u0433\u043e! \u041e\u043d \u043d\u0435 \u043f\u0440\u0435\u0434\u043d\u0430\u0437\u043d\u0430\u0447\u0435\u043d \u0434\u043b\u044f \u044d\u0442\u043e\u0439 \u0437\u0430\u0434\u0430\u0447\u0438!\u00bb. \u041a\u043e\u043d\u0435\u0447\u043d\u043e, \u0434\u043e\u0440\u0430\u0431\u043e\u0442\u043a\u0438 \u043d\u0435\u0438\u0437\u0431\u0435\u0436\u043d\u044b, \u0438 \u0434\u0430\u0436\u0435 \u043d\u0443\u0436\u043d\u044b. \u041d\u043e \u044d\u0442\u043e \u043d\u0435 \u0434\u043e\u043b\u0436\u043d\u044b \u0431\u044b\u0442\u044c \u0434\u043e\u0440\u0430\u0431\u043e\u0442\u043a\u0438 \u043f\u043e \u0442\u0438\u043f\u0443 \u043f\u0440\u043e\u043a\u0438\u043d\u0443\u0442\u044c \u043d\u043e\u0432\u044b\u0439 \u043f\u0440\u043e\u043f\u0441, \u0447\u0442\u043e\u0431\u044b \u0443\u0432\u0435\u043b\u0438\u0447\u0438\u0442\u044c \u043e\u0442\u0441\u0442\u0443\u043f \u0441 4px \u0434\u043e 8px, \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\u0434\u043d\u043e\u043c-\u0434\u0432\u0443\u0445 \u0441\u043b\u0443\u0447\u0430\u044f\u0445 \u0438\u0437 \u043f\u044f\u0442\u0438\u0434\u0435\u0441\u044f\u0442\u0438. \u041a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u044b \u0434\u043e\u043b\u0436\u043d\u044b \u0438\u043c\u0435\u0442\u044c \u043d\u0430\u0441\u0442\u0440\u0430\u0438\u0432\u0430\u0435\u043c\u0443\u044e \u0432\u043d\u0435\u0448\u043d\u044e\u044e \u0433\u0435\u043e\u043c\u0435\u0442\u0440\u0438\u044e.<\/p>\n<h3>TypeScript, \u0432\u044b\u0440\u0443\u0447\u0430\u0439<\/h3>\n<p>  \u0420\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043f\u043e \u0441\u043c\u044b\u0441\u043b\u0443 \u043d\u0443\u0436\u043d\u043e \u0440\u0430\u0441\u043f\u043e\u043b\u0430\u0433\u0430\u0442\u044c, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u0432 <code>src\/Library\/Controls.ts<\/code>. \u041a \u043f\u043e\u043b\u044f\u043c \u043f\u0440\u0438\u0432\u0435\u0434\u0435\u043d\u044b \u043a\u0440\u0430\u0442\u043a\u0438\u0435 \u043a\u043e\u043c\u043c\u0435\u043d\u0442\u0430\u0440\u0438\u0438, \u043d\u0438\u0436\u0435 \u043c\u044b \u0440\u0430\u0437\u0431\u0435\u0440\u0451\u043c \u0438\u0445 \u043f\u043e\u0434\u0440\u043e\u0431\u043d\u0435\u0435.<\/p>\n<pre><code class=\"javascript\">export interface VisualComponentProps { \t\/\/ \u0412\u043b\u043e\u0436\u0435\u043d\u043d\u044b\u0435 \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u044b. \u041e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u043e \u0434\u043b\u044f \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u0430-\u0444\u0443\u043d\u043a\u0446\u0438\u0438 \tchildren?: React.ReactNode; \t\/\/ \u041a\u0430\u043a \u0438 \u0432 css \tclassName?: string; \t\/\/ \u0410\u043a\u0442\u0438\u0432\u043d\u044b\u0439 \u0444\u043b\u0430\u0433 \u043e\u0437\u043d\u0430\u0447\u0430\u0435\u0442, \u0447\u0442\u043e \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442 \u043d\u0435 \u0431\u0443\u0434\u0435\u0442 \u043e\u0442\u0440\u0438\u0441\u043e\u0432\u0430\u043d. \tdoNotRender?: boolean; \t\/\/ \u042d\u0442\u043e \u0431\u0443\u0434\u0435\u0442 \u043e\u0442\u0440\u0438\u0441\u043e\u0432\u0430\u043d\u043e \u043f\u0440\u0438 doNotRender true \tfallback?: JSX.Element; \t\/\/ \u041a\u0430\u043a \u0438 \u0432 css \tstyle?: React.CSSProperties; } <\/code><\/pre>\n<p>  \u042d\u0442\u043e \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441 \u043f\u0440\u043e\u043f\u0441\u043e\u0432 \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u043e\u0432. \u041a\u0430\u043a\u0438\u0445? \u0412\u0441\u0435\u0445 \u0432\u0438\u0437\u0443\u0430\u043b\u044c\u043d\u044b\u0445 \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u043e\u0432. \u041e\u043d\u0438 \u0434\u043e\u043b\u0436\u043d\u044b \u043f\u0440\u0438\u043c\u0435\u043d\u044f\u0442\u044c\u0441\u044f \u043d\u0430 \u0435\u0433\u043e \u043a\u043e\u0440\u043d\u0435\u0432\u043e\u0439 \u044d\u043b\u0435\u043c\u0435\u043d\u0442.<\/p>\n<p>  \u041f\u0440\u043e\u043f\u0441\u044b \u043a\u0430\u0436\u0434\u043e\u0433\u043e \u0440\u0430\u0437\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u0435\u043c\u043e\u0433\u043e \u0432\u0438\u0437\u0443\u0430\u043b\u044c\u043d\u043e\u0433\u043e \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u0430 \u0441\u043b\u0435\u0434\u0443\u0435\u0442 \u0440\u0430\u0441\u0448\u0438\u0440\u044f\u0442\u044c, \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044f \u044d\u0442\u043e\u0442 \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441.<\/p>\n<p>  \u0421\u0440\u0430\u0437\u0443 \u043f\u0440\u043e\u0448\u0443 \u043e\u0431\u0440\u0430\u0442\u0438\u0442\u044c \u0432\u043d\u0438\u043c\u0430\u043d\u0438\u0435 \u043d\u0430 \u0442\u043e, \u0447\u0442\u043e \u0432\u0441\u0435 \u044d\u0442\u0438 \u043f\u0440\u043e\u043f\u0441\u044b \u043e\u043f\u0446\u0438\u043e\u043d\u0430\u043b\u044c\u043d\u044b. \u0420\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u0438\u0445. <\/p>\n<ul>\n<li><code>children<\/code> \u0435\u0441\u0442\u044c \u0432 \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u0430\u0445-\u043a\u043b\u0430\u0441\u0441\u0430\u0445 React.Component, \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u0430\u0445-\u0444\u0443\u043d\u043a\u0446\u0438\u044f\u0445 React.FC, \u043d\u043e \u0438\u0445 \u043d\u0435\u0442 \u0432 \u043e\u0431\u044b\u0447\u043d\u044b\u0445 \u0444\u0443\u043d\u043a\u0446\u0438\u044f\u0445 \u0431\u0435\u0437 \u0437\u0430\u0434\u0430\u043d\u0438\u044f \u0442\u0438\u043f\u0438\u0437\u0430\u0446\u0438\u0438 React.FC. \u041f\u043e\u044d\u0442\u043e\u043c\u0443 \u0437\u0430\u0434\u0430\u0451\u043c \u0435\u0433\u043e. <\/li>\n<li><code>className\/style<\/code> \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c \u0430\u043d\u0430\u043b\u043e\u0433\u0438\u0447\u043d\u044b\u0435 \u043d\u0430\u0437\u0432\u0430\u043d\u0438\u044f, \u043a\u0430\u043a \u0432 \u043e\u0431\u044b\u0447\u043d\u043e\u043c JSX&#8217;\u043d\u043e\u043c &lt;div \/&gt;. \u041d\u0435 \u043f\u043b\u043e\u0434\u0438\u043c \u0441\u0435\u043c\u0430\u043d\u0442\u0438\u043a\u0443. \u042d\u0442\u043e\u0442 \u043f\u0440\u0438\u043d\u0446\u0438\u043f \u0442\u043e\u0436\u0434\u0435\u0441\u0442\u0432\u0435\u043d\u043d\u043e\u0441\u0442\u0438 \u043d\u0430\u0437\u0432\u0430\u043d\u0438\u044f \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, <a href=\"https:\/\/reactjs.org\/docs\/refs-and-the-dom.html#adding-a-ref-to-a-dom-element\">\u0432 \u043f\u0440\u043e\u043f\u0441\u0435 \u0434\u043b\u044f \u0437\u0430\u0434\u0430\u043d\u0438\u044f \u0441\u0441\u044b\u043b\u043a\u0438 ref<\/a>.<\/li>\n<li><code>doNotRender<\/code> \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u043a\u0430\u043a \u0430\u043b\u044c\u0442\u0435\u0440\u043d\u0430\u0442\u0438\u0432\u0430 \u043d\u0430\u0431\u043e\u043b\u0435\u0432\u0448\u0435\u043c\u0443 \u043a\u043e\u0441\u0442\u044b\u043b\u044c\u043d\u043e\u043c\u0443 \u0432 JSX <a href=\"https:\/\/reactjs.org\/docs\/conditional-rendering.html#inline-if-with-logical--operator\">\u0440\u0435\u043d\u0434\u0435\u0440\u0443 \u043f\u043e \u0443\u0441\u043b\u043e\u0432\u0438\u044e<\/a>. \u041f\u0440\u0438\u043c\u0435\u043d\u044f\u044f \u044d\u0442\u043e \u0440\u0435\u0448\u0435\u043d\u0438\u0435, \u043d\u0430\u043c \u043d\u0435 \u043d\u0443\u0436\u043d\u043e \u0433\u043e\u0440\u043e\u0434\u0438\u0442\u044c \u0444\u0438\u0433\u0443\u0440\u043d\u044b\u0435 \u0441\u043a\u043e\u0431\u043a\u0438 \u0432 render \u043c\u0435\u0442\u043e\u0434\u0430\u0445, \u0443\u0445\u0443\u0434\u0448\u0430\u044f \u0447\u0438\u0442\u0430\u0435\u043c\u043e\u0441\u0442\u044c \u043a\u043e\u0434\u0430. \u0421\u0440\u0430\u0432\u043d\u0438\u0442\u0435 2 \u0444\u0440\u0430\u0433\u043c\u0435\u043d\u0442\u0430 \u043a\u043e\u0434\u0430:\n<p>  Virgin conditional rendering:<\/p>\n<p>  <code>App.tsx<\/code><\/p>\n<pre><code class=\"javascript\">renderComponent() { \tconst {props, state} = this; \tconst needRender = state.something;  \treturn ( \t\t&lt;PageLayout&gt; \t\t\t&lt;UIButton \t\t\t\tchildren={'This is a button'} \t\t\t\/&gt;  \t\t\t{needRender &&  \t\t\t\t&lt;UIButton \t\t\t\t\tchildren={'This is another button'} \t\t\t\t\/&gt; \t\t\t} \t\t&lt;\/PageLayout&gt; \t); } <\/code><\/pre>\n<p>  Chad \u043f\u0440\u043e\u043f\u0441 doNotRender:<\/p>\n<p>  <code>App.tsx<\/code><\/p>\n<pre><code class=\"javascript\">renderComponent() { \tconst {props, state} = this; \tconst needRender = state.something;  \treturn ( \t\t&lt;PageLayout&gt; \t\t\t&lt;UIButton \t\t\t\tchildren={'This is a button'} \t\t\t\/&gt; \t\t\t&lt;UIButton \t\t\t\tchildren={'This is another button'} \t\t\t\tdoNotRender={!needRender} \t\t\t\/&gt; \t\t&lt;\/PageLayout&gt; \t); } <\/code><\/pre>\n<p>  \u0412 \u043f\u0435\u0440\u0432\u043e\u043c \u0432\u0430\u0440\u0438\u0430\u043d\u0442\u0435 \u043c\u044b \u0443\u0432\u0435\u043b\u0438\u0447\u0438\u0432\u0430\u0435\u043c \u0443\u0440\u043e\u0432\u0435\u043d\u044c \u0432\u043b\u043e\u0436\u0435\u043d\u043d\u043e\u0441\u0442\u0438 \u043d\u0438\u0436\u043d\u0435\u0439 \u043a\u043d\u043e\u043f\u043a\u0438, \u0445\u043e\u0442\u044f \u043f\u043e \u0441\u043c\u044b\u0441\u043b\u0443 \u0435\u0451 \u0432\u043b\u043e\u0436\u0435\u043d\u043d\u043e\u0441\u0442\u044c \u043d\u0430 \u0442\u043e\u043c \u0436\u0435 \u0443\u0440\u043e\u0432\u043d\u0435, \u0447\u0442\u043e \u0438 \u0432\u0435\u0440\u0445\u043d\u044f\u044f. \u042d\u0442\u043e \u0441\u043c\u043e\u0442\u0440\u0438\u0442\u0441\u044f \u043f\u043b\u043e\u0445\u043e \u0432 \u043c\u043e\u0451\u043c \u0440\u0435\u0434\u0430\u043a\u0442\u043e\u0440\u0435, \u0433\u0434\u0435 \u044f \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e tab \u0448\u0438\u0440\u0438\u043d\u043e\u0439 \u0432 2 \u043f\u0440\u043e\u0431\u0435\u043b\u0430, \u0430 \u0437\u0434\u0435\u0441\u044c \u0438 \u0442\u043e\u0433\u043e \u0445\u0443\u0436\u0435.<\/p>\n<p>  \u0412\u043e \u0432\u0442\u043e\u0440\u043e\u043c \u0432\u0430\u0440\u0438\u0430\u043d\u0442\u0435 \u0438\u043c\u0435\u0435\u043c \u0440\u0430\u0432\u043d\u0443\u044e \u0432\u043b\u043e\u0436\u0435\u043d\u043d\u043e\u0441\u0442\u044c, \u0437\u0430 \u043c\u0438\u043d\u0443\u0441\u043e\u043c, \u0447\u0442\u043e doNotRender \u043c\u043e\u0436\u0435\u0442 \u043d\u0435 \u0431\u0440\u043e\u0441\u0438\u0442\u044c\u0441\u044f \u0432 \u0433\u043b\u0430\u0437\u0430 \u0438 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a \u043d\u0435 \u043f\u043e\u0439\u043c\u0451\u0442 \u0447\u0442\u043e \u043f\u0440\u043e\u0438\u0441\u0445\u043e\u0434\u0438\u0442. \u041d\u043e, \u0435\u0441\u043b\u0438 \u0432 \u0432\u0430\u0448\u0435\u043c \u043f\u0440\u043e\u0435\u043a\u0442\u0435 \u043a\u0430\u0436\u0434\u044b\u0439 \u0432\u0438\u0437\u0443\u0430\u043b\u044c\u043d\u044b\u0439 \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442 \u0441\u0434\u0435\u043b\u0430\u043d \u043f\u043e \u044d\u0442\u043e\u043c\u0443 \u043f\u0440\u0438\u043d\u0446\u0438\u043f\u0443, \u0442\u043e \u044d\u0442\u0430 \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u0430 \u0441\u0440\u0430\u0437\u0443 \u0443\u0445\u043e\u0434\u0438\u0442.  <\/li>\n<li><code>fallback<\/code> \u043d\u0443\u0436\u0435\u043d, \u0435\u0441\u043b\u0438 \u043c\u044b \u043d\u0435 \u0445\u043e\u0442\u0438\u043c \u0440\u0435\u043d\u0434\u0435\u0440\u0438\u0442\u044c <code>null<\/code> \u043f\u0440\u0438 <code>doNotRender true<\/code>, \u0430 \u043a\u0430\u043a\u043e\u0439-\u0442\u043e \u043a\u0430\u0441\u0442\u043e\u043c\u043d\u044b\u0439 \u044d\u043b\u0435\u043c\u0435\u043d\u0442. \u0418\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u043f\u043e \u0430\u043d\u0430\u043b\u043e\u0433\u0438\u0438 <a href=\"https:\/\/reactjs.org\/docs\/concurrent-mode-suspense.html\">React Suspense<\/a>, \u0442\u0430\u043a \u043a\u0430\u043a \u0438\u043c\u0435\u0435\u0442 \u0441\u0445\u043e\u0436\u0438\u0439 \u0441\u043c\u044b\u0441\u043b (\u043d\u0435 \u043f\u043b\u043e\u0434\u0438\u043c \u0441\u0435\u043c\u0430\u043d\u0442\u0438\u043a\u0443)<\/li>\n<\/ul>\n<p>  \u0425\u043e\u0447\u0443 \u043f\u043e\u043a\u0430\u0437\u0430\u0442\u044c, \u043a\u0430\u043a \u044d\u0442\u043e \u043f\u0440\u0430\u0432\u0438\u043b\u044c\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c. \u0421\u0434\u0435\u043b\u0430\u0435\u043c \u043f\u0440\u043e\u0441\u0442\u0435\u043d\u044c\u043a\u0443\u044e \u043a\u043d\u043e\u043f\u043e\u0447\u043a\u0443.<\/p>\n<p>  \u041f\u0440\u0438\u043c\u0435\u0447\u0430\u043d\u0438\u0435: \u0432 \u043a\u043e\u0434\u0435 \u043d\u0438\u0436\u0435 \u044f \u0442\u0430\u043a\u0436\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e css-modules, sass \u0438 classnames.<\/p>\n<p>  <code>UIButton.tsx<\/code><\/p>\n<pre><code class=\"javascript\">import * as React from 'react'; import { VisualComponentProps } from 'Library\/Controls'; import * as css from '.\/Button.sass'; import cn from 'classnames';  \/\/ \u0420\u0430\u0441\u0448\u0438\u0440\u044f\u0435\u043c (\u043d\u0430\u0441\u043b\u0435\u0434\u0443\u0435\u043c) \u043f\u0440\u043e\u043f\u0441\u044b export interface ButtonBasicProps { \tdisabled?: boolean; } export interface ButtonProps extends ButtonBasicProps, VisualComponentProps {}  export function UIButton(props: ButtonProps) { \t\/\/ \u041d\u0435 \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u043c undefined, \u0438\u043d\u0430\u0447\u0435 \u0440\u0435\u0430\u043a\u0442 \u0431\u0443\u0434\u0435\u0442 \u043c\u0430\u0442\u0435\u0440\u0438\u0442\u044c\u0441\u044f \t\/\/ &quot;Nothing was returned from render.&quot; \tif (props.doNotRender) return props.fallback || null;  \t\/\/ \u041e\u0431\u044a\u0435\u0434\u0438\u043d\u044f\u0435\u043c \u0432\u0441\u0435 \u043a\u043b\u0430\u0441\u0441\u044b \u0432 \u0441\u0442\u0440\u043e\u043a\u0443 \tconst rootClassNames = cn( \t\t\/\/ \u041a\u043b\u0430\u0441\u0441, \u043e\u043f\u0438\u0441\u0430\u043d\u043d\u044b\u0439 \u0432 sass \t\tcss.Button, \t\t\/\/ \u041a\u043b\u0430\u0441\u0441\u044b, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043c\u043e\u0436\u043d\u043e \u043f\u0440\u043e\u043a\u0438\u043d\u0443\u0442\u044c \u0447\u0435\u0440\u0435\u0437 props \t\tprops.className, \t\t\/\/ \u041e\u0431\u044b\u0447\u043d\u044b\u0435 \u043a\u043b\u0430\u0441\u0441\u044b \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u0430 \u043f\u043e \u0443\u0441\u043b\u043e\u0432\u0438\u044e \t\tprops.disabled && css._disabled \t);  \treturn ( \t\t&lt;div \t\t\tchildren={props.children} \t\t\tclassName={rootClassNames} \t\t\tstyle={props.style} \t\t\/&gt; \t) } <\/code><\/pre>\n<p>  <code>App.tsx<\/code><\/p>\n<pre><code class=\"javascript\">renderComponent() { \tconst {props, state} = this; \tconst needRenderSecond = true;  \treturn ( \t\t&lt;PageLayout&gt; \t\t\t&lt;UIButton \t\t\t\tchildren={'This is a button'} \t\t\t\tstyle={{marginRight: needRenderSecond ? 5 : null}} \t\t\t\/&gt; \t\t\t&lt;UIButton \t\t\t\tdisabled \t\t\t\tchildren={'This is another button'} \t\t\t\tdoNotRender={!needRenderSecond} \t\t\t\/&gt; \t\t&lt;\/PageLayout&gt; \t); } <\/code><\/pre>\n<p>  \u0420\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442:<\/p>\n<p>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/fe\/to\/j7\/fetoj7kw1albfk8gj0xq2ifypgo.png\"\/><\/p>\n<h3>\u0420\u0435\u0444\u043b\u0435\u043a\u0441\u0438\u044f \u0438 \u0437\u0430\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435<\/h3>\n<p>  \u0422\u0430\u043a\u0438\u043c\u0438 \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u0430\u043c\u0438 \u0443\u0434\u043e\u0431\u043d\u043e \u043e\u043f\u0435\u0440\u0438\u0440\u043e\u0432\u0430\u0442\u044c, \u043a\u0430\u043a div&#8217;\u0430\u043c\u0438, \u0441\u043e\u0437\u0434\u0430\u0432\u0430\u044f \u0440\u0430\u0437\u043b\u0438\u0447\u043d\u044b\u0435 \u043e\u0431\u0435\u0440\u0442\u043a\u0438, \u043a\u043e\u043c\u043f\u043e\u0437\u0438\u0446\u0438\u0438, \u0441\u043f\u0435\u0446\u0438\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438, <u>\u0432\u044b\u0445\u043e\u0434\u044f \u0437\u0430 \u0440\u0430\u043c\u043a\u0438 \u0437\u0430\u043b\u043e\u0436\u0435\u043d\u043d\u043e\u0433\u043e \u0432 \u043d\u0438\u0445 \u0438\u0437\u043d\u0430\u0447\u0430\u043b\u044c\u043d\u043e\u0433\u043e \u0444\u0443\u043d\u043a\u0446\u0438\u043e\u043d\u0430\u043b\u0430<\/u>.<\/p>\n<p>  \u041c\u043e\u0436\u043d\u043e \u0432\u043e\u0437\u0440\u0430\u0437\u0438\u0442\u044c, \u0447\u0442\u043e \u0440\u0430\u0437 \u0432 \u0434\u0438\u0437\u0430\u0439\u043d-\u0441\u0438\u0441\u0442\u0435\u043c\u0435 \u043d\u0435\u0442 \u0443\u0441\u043b\u043e\u0432\u043d\u044b\u0445 \u0436\u0435\u043b\u0442\u044b\u0445 \u043a\u043d\u043e\u043f\u043e\u043a, \u0430 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u0443 \u043d\u0443\u0436\u043d\u043e \u0438\u0445 \u0441\u0434\u0435\u043b\u0430\u0442\u044c, \u0437\u043d\u0430\u0447\u0438\u0442 \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u0430 \u043d\u0435 \u0432 \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u0430\u0445, \u0430 \u0432 \u0442\u043e\u043c, \u0447\u0442\u043e \u044d\u0442\u0443 \u043d\u0430\u0434\u043e\u0431\u043d\u043e\u0441\u0442\u044c \u0441\u043e\u0437\u0434\u0430\u0451\u0442. \u0422\u0435\u043c \u043d\u0435 \u043c\u0435\u043d\u0435\u0435, \u0440\u0435\u0430\u043b\u0438\u0438 \u0442\u0430\u043a\u043e\u0432\u044b, \u0447\u0442\u043e \u0442\u0430\u043a\u0438\u0435 \u0441\u0438\u0442\u0443\u0430\u0446\u0438\u0438 \u0432\u043e\u0437\u043d\u0438\u043a\u0430\u044e\u0442, \u0438 \u0434\u043e\u0432\u043e\u043b\u044c\u043d\u043e \u0447\u0430\u0441\u0442\u043e. &quot;\u2026 \u0410 \u0436\u0438\u0442\u044c-\u0442\u043e \u043d\u0430\u0434\u043e! \u041d\u0430\u0434\u043e \u0436\u0438\u0442\u044c.&quot; \u041a \u0442\u043e\u043c\u0443 \u0436\u0435, \u043f\u0440\u0438\u043d\u0446\u0438\u043f \u043a\u0430\u0441\u043a\u0430\u0434\u0430 css \u043d\u0435 \u0432\u0441\u0435\u0433\u0434\u0430 \u043c\u043e\u0436\u043d\u043e \u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u0442\u044c \u043d\u0430 \u043f\u0440\u0430\u043a\u0442\u0438\u043a\u0435, \u0438 \u0443 \u0432\u0430\u0441 \u043c\u043e\u0433\u0443\u0442 \u0432\u043e\u0437\u043d\u0438\u043a\u0430\u0442\u044c \u0441\u043b\u0443\u0447\u0430\u0438, \u043a\u043e\u0433\u0434\u0430 \u0432\u0430\u0448\u0438 \u0441\u0442\u0438\u043b\u0438 \u043f\u0440\u043e\u0441\u0442\u043e-\u043d\u0430\u043f\u0440\u043e\u0441\u0442\u043e \u043f\u0435\u0440\u0435\u043a\u0440\u044b\u0432\u0430\u044e\u0442\u0441\u044f \u0431\u043e\u043b\u0435\u0435 \u0432\u044b\u0441\u043e\u043a\u043e\u0439 \u0441\u043f\u0435\u0446\u0438\u0444\u0438\u0447\u043d\u043e\u0441\u0442\u044c\u044e \u0434\u0440\u0443\u0433\u043e\u0433\u043e \u0441\u0435\u043b\u0435\u043a\u0442\u043e\u0440\u0430 (\u0438\u043b\u0438 \u043e\u043f\u0438\u0441\u0430\u043d\u044b \u0432\u044b\u0448\u0435). \u0422\u0443\u0442 \u043a\u0430\u043a \u0440\u0430\u0437 \u0432\u044b\u0440\u0443\u0447\u0430\u0435\u0442 style.<\/p>\n<p>  \u041d\u0430\u043f\u043e\u0441\u043b\u0435\u0434\u043e\u043a, \u0434\u043e\u0431\u0430\u0432\u043b\u044e \u043f\u0430\u0440\u0443 (\u0431\u0443\u043a\u0432\u0430\u043b\u044c\u043d\u043e) \u043c\u043e\u043c\u0435\u043d\u0442\u043e\u0432.<\/p>\n<ol>\n<li>\u0423\u0447\u0438\u0442\u044b\u0432\u0430\u0439\u0442\u0435, \u0447\u0442\u043e doNotRender \u043d\u0435 \u043f\u043e\u043b\u043d\u043e\u0441\u0442\u044c\u044e \u043f\u043e\u0432\u0442\u043e\u0440\u044f\u0435\u0442 \u043f\u043e\u0432\u0435\u0434\u0435\u043d\u0438\u0435 conditional rendering. \u0423 \u0432\u0430\u0441 \u0442\u0430\u043a\u0436\u0435 \u0431\u0443\u0434\u0443\u0442 \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0442\u044c\u0441\u044f \u043c\u0435\u0442\u043e\u0434\u044b \u0436\u0438\u0437\u043d\u0435\u043d\u043d\u043e\u0433\u043e \u0446\u0438\u043a\u043b\u0430, \u043f\u0440\u043e\u0441\u0442\u043e render \u0431\u0443\u0434\u0435\u0442 \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0442\u044c fallback \u0438\u043b\u0438 null. \u0412 \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u0441\u043b\u043e\u0436\u043d\u044b\u0445 \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u0430\u0445 \u0432\u044b \u0437\u0430\u0445\u043e\u0442\u0438\u0442\u0435 \u0438\u0437\u0431\u0435\u0436\u0430\u0442\u044c \u0438\u0441\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f \u043c\u0435\u0442\u043e\u0434\u043e\u0432 \u0436\u0438\u0437\u043d\u0435\u043d\u043d\u043e\u0433\u043e \u0446\u0438\u043a\u043b\u0430. \u0414\u043b\u044f \u044d\u0442\u043e\u0433\u043e, \u0432\u0430\u043c \u043f\u0440\u043e\u0441\u0442\u043e \u043d\u0443\u0436\u043d\u043e \u0441\u0434\u0435\u043b\u0430\u0442\u044c built-in <a href=\"https:\/\/reactjs.org\/docs\/composition-vs-inheritance.html#specialization\">\u0441\u043f\u0435\u0446\u0438\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044e<\/a> \u0432\u0430\u0448\u0435\u0433\u043e \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u0430.\n<p>  \u041d\u0430 \u043f\u0440\u0438\u043c\u0435\u0440\u0435 UIButton: \u043f\u0435\u0440\u0435\u0438\u043c\u0435\u043d\u0443\u0439\u0442\u0435 UIButton \u0432 UIButtonInner \u0438 \u0434\u043e\u0431\u0430\u0432\u044c\u0442\u0435 \u043f\u043e\u0434 \u043d\u0438\u043c \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0439 \u043a\u043e\u0434:<\/p>\n<p>  <code>UIButton.tsx<\/code><\/p>\n<pre><code class=\"javascript\">export function UIButton(props: ButtonProps) { \tif (props.doNotRender) return props.fallback || null; \treturn &lt;UIButtonInner {...props} \/&gt;; } <\/code><\/pre>\n<p>  P.S. \u041d\u0435 \u0441\u043e\u0432\u0435\u0440\u0448\u0430\u0439\u0442\u0435 \u043e\u0448\u0438\u0431\u043a\u0443 \u0440\u0435\u043a\u0443\u0440\u0441\u0438\u0432\u043d\u043e\u0433\u043e \u0432\u044b\u0437\u043e\u0432\u0430 UIButton \u0432 \u0434\u0430\u043d\u043d\u043e\u0439 \u0444\u0443\u043d\u043a\u0446\u0438\u0438!   <\/li>\n<li>\u0412 \u0440\u0435\u0434\u043a\u0438\u0445 \u0441\u043b\u0443\u0447\u0430\u044f\u0445, \u043a\u043e\u0433\u0434\u0430 \u043c\u043e\u0433\u0443\u0442 \u043d\u0435\u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e \u043c\u0435\u043d\u044f\u0442\u044c\u0441\u044f \u0441\u0442\u0438\u043b\u0438 \u043d\u0430 \u043e\u0431\u0435\u0440\u0442\u043a\u0435 \u0438 \u043d\u0430 \u043e\u0431\u043e\u0440\u0430\u0447\u0438\u0432\u0430\u0435\u043c\u043e\u043c \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u0435, \u0432\u0430\u043c \u043c\u043e\u0436\u0435\u0442 \u043f\u0440\u0438\u0433\u043e\u0434\u0438\u0442\u044c\u0441\u044f \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0439 \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441\n<p>  <code>Library\/Controls.ts<\/code><\/p>\n<pre><code class=\"javascript\">export interface VisualComponentWrapperProps extends VisualComponentProps { \twrappedVisual?: VisualComponentProps; } <\/code><\/pre>\n<p>  <\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">\u0418 \u0435\u0433\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435<\/b><\/p>\n<div class=\"spoiler_text\"><code>UIButton.tsx<\/code><\/p>\n<pre><code class=\"javascript\">interface ButtonSomeWrapperProps extends ButtonBasicProps, VisualComponentWrapperProps { \tmyCustomProp?: number; }  export function UIButtonSomeWrapper(props: ButtonSomeWrapperProps) { \tif (props.doNotRender) return props.fallback || null;  \tconst { \t\t\/\/ \u041f\u0440\u043e\u043f\u0441\u044b VisualComponentProps \u043e\u0431\u0435\u0440\u0442\u043a\u0438 \t\tstyle, className, children, fallback, doNotRender, \t\t\/\/ VisualComponentProps \u043e\u0431\u043e\u0440\u0430\u0447\u0438\u0432\u0430\u0435\u043c\u043e\u0433\u043e \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u0430 \t\twrappedVisual, \t\t\/\/ \u0421\u043e\u0431\u0441\u0442\u0432\u0435\u043d\u043d\u044b\u0435 \u043f\u0440\u043e\u043f\u0441\u044b \u043e\u0431\u0435\u0440\u0442\u043a\u0438 \t\tmyCustomProp, \t\t\/\/ \u0421\u043e\u0431\u0441\u0442\u0432\u0435\u043d\u043d\u044b\u0435 \u043f\u0440\u043e\u043f\u0441\u044b \u043e\u0431\u043e\u0440\u0430\u0447\u0438\u0432\u0430\u0435\u043c\u043e\u0433\u043e \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u0430 \t\t...uiButtonProps \t} = props;  \treturn ( \t\t&lt;div \t\t\tstyle={style} \t\t\tclassName={className} \t\t&gt; \t\t\t{myCustomProp} \t\t\t&lt;UIButton \t\t\t\t{...wrappedVisual} \t\t\t\t{...uiButtonProps} \t\t\t\/&gt; \t\t\t{children} \t\t&lt;\/div&gt; \t); } <\/code><\/pre>\n<\/div>\n<\/div>\n<\/li>\n<\/ol>\n<p>  \u0420\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0430 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u0441 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435\u043c \u044d\u0442\u043e\u0433\u043e \u043f\u043e\u0434\u0445\u043e\u0434\u0430 \u0437\u043d\u0430\u0447\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u043f\u043e\u0432\u044b\u0441\u0438\u0442 \u0440\u0435\u044e\u0437\u0430\u0431\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u044c \u0432\u0430\u0448\u0438\u0445 \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u043e\u0432, \u0441\u043d\u0438\u0437\u0438\u0442 \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u043b\u0438\u0448\u043d\u0438\u0445 \u043a\u043e\u0441\u0442\u044b\u043b\u044c\u043d\u044b\u0445 \u0441\u0442\u0438\u043b\u0435\u0439 (\u0440\u0435\u0447\u044c \u043e \u0441\u0442\u0438\u043b\u044f\u0445, \u043e\u043f\u0438\u0441\u0430\u043d\u043d\u044b\u0445 \u0432 \u0444\u0430\u0439\u043b\u0430\u0445 \u0441\u0442\u0438\u043b\u044f \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u0430 \u0438\u0441\u043a\u043b\u044e\u0447\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u0434\u043b\u044f \u043d\u0443\u0436\u0434\u044b \u0434\u0440\u0443\u0433\u0438\u0445 \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u043e\u0432) \u0438 \u043f\u0440\u043e\u043f\u0441\u043e\u0432, \u0434\u043e\u0431\u0430\u0432\u0438\u0442 \u043a\u043e\u0434\u0443 \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u043e\u0441\u0442\u0438. \u041d\u0430 \u044d\u0442\u043e\u043c \u0432\u0441\u0451. \u0412 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u0439 \u0441\u0442\u0430\u0442\u044c\u0435 \u043d\u0430\u0447\u043d\u0435\u043c \u0440\u0435\u0448\u0430\u0442\u044c \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u044b \u0440\u0435\u044e\u0437\u0430\u0431\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u0438 \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u043e\u0432 \u0431\u043e\u043b\u044c\u0448\u0435 \u0441 \u0442\u043e\u0447\u043a\u0438 \u0437\u0440\u0435\u043d\u0438\u044f \u043a\u043e\u0434\u0430, \u043d\u0435\u0436\u0435\u043b\u0438 css. \u041b\u0438\u0431\u043e \u043d\u0430\u043f\u0438\u0448\u0443 \u043e \u0447\u0451\u043c-\u043d\u0438\u0431\u0443\u0434\u044c \u0431\u043e\u043b\u0435\u0435 \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u043e\u043c. \u0421\u043f\u0430\u0441\u0438\u0431\u043e \u0437\u0430 \u0432\u043d\u0438\u043c\u0430\u043d\u0438\u0435.<\/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\/479714\/\"> https:\/\/habr.com\/ru\/post\/479714\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"\n<div class=\"post__text post__text-html js-mediator-article\" id=\"post-content-body\" data-io-article-url=\"https:\/\/habr.com\/ru\/post\/479714\/\"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/00\/7v\/55\/007v55-c7k0gjfzqkhtoy0irbma.png\"\/><\/p>\n<p>  \u0414\u0430\u043d\u043d\u0430\u044f \u0441\u0442\u0430\u0442\u044c\u044f \u0431\u0443\u0434\u0435\u0442, \u043f\u0440\u0435\u0436\u0434\u0435 \u0432\u0441\u0435\u0433\u043e, \u043f\u043e\u043b\u0435\u0437\u043d\u0430 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u0430\u043c, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043d\u0435 \u0440\u0430\u0431\u043e\u0442\u0430\u044e\u0442 \u0441 \u0433\u043e\u0442\u043e\u0432\u044b\u043c\u0438 \u043d\u0430\u0431\u043e\u0440\u0430\u043c\u0438 \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u043e\u0432, \u0442\u0430\u043a\u0438\u043c\u0438 \u043a\u0430\u043a, material-ui, \u0430 \u0440\u0435\u0430\u043b\u0438\u0437\u0443\u044e\u0442 \u0441\u0432\u043e\u0438. \u041d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u0434\u043b\u044f \u043f\u0440\u043e\u0434\u0443\u043a\u0442\u0430 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0430\u043d \u0434\u0438\u0437\u0430\u0439\u043d, \u043e\u0442\u0440\u0430\u0436\u0430\u044e\u0449\u0438\u0439 \u0442\u043e, \u043a\u0430\u043a \u0434\u043e\u043b\u0436\u043d\u044b \u0432\u044b\u0433\u043b\u044f\u0434\u0435\u0442\u044c \u043a\u043d\u043e\u043f\u043e\u0447\u043a\u0438, \u043c\u043e\u0434\u0430\u043b\u044c\u043d\u044b\u0435 \u043e\u043a\u043d\u0430 \u0438 \u0442.\u043f. \u0427\u0442\u043e\u0431\u044b \u0433\u0440\u0430\u043c\u043e\u0442\u043d\u043e \u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u0442\u044c \u0442\u0430\u043a\u0443\u044e \u0434\u0438\u0437\u0430\u0439\u043d-\u0441\u0438\u0441\u0442\u0435\u043c\u0443, \u043f\u043e\u0442\u0440\u0435\u0431\u0443\u0435\u0442\u0441\u044f \u0432\u0441\u0435\u043c \u0435\u0451 \u0430\u0442\u043e\u043c\u0430\u043c \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u0442\u044c \u0445\u043e\u0440\u043e\u0448\u0443\u044e \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u043a\u0443 \u0438\u0445 \u043a\u043e\u043c\u043f\u043e\u0437\u0438\u0446\u0438\u0438. \u0418\u043d\u044b\u043c\u0438 \u0441\u043b\u043e\u0432\u0430\u043c\u0438, \u043d\u0443\u0436\u043d\u043e \u0434\u043e\u0431\u0438\u0442\u044c\u0441\u044f \u0442\u043e\u0433\u043e, \u0447\u0442\u043e\u0431\u044b \u043b\u044e\u0431\u043e\u0439 \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u043e \u0432\u0437\u044f\u0442\u044b\u0439 \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442 \u043c\u043e\u0433 \u0438\u043d\u0442\u0435\u0433\u0440\u0438\u0440\u043e\u0432\u0430\u0442\u044c\u0441\u044f \u0438 \u0438\u0434\u0435\u0430\u043b\u044c\u043d\u043e \u0432\u043f\u0438\u0441\u044b\u0432\u0430\u0442\u044c\u0441\u044f \u0432 \u0431\u043e\u043b\u044c\u0448\u0438\u0439 \u0441\u043e\u0441\u0442\u0430\u0432\u043d\u043e\u0439 \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442. \u0410 \u0435\u0441\u043b\u0438 \u043e\u043d \u043d\u0435 \u0432\u043f\u0438\u0441\u044b\u0432\u0430\u0435\u0442\u0441\u044f, \u0442\u043e \u0431\u044b\u043b\u043e \u0431\u044b \u043d\u0435\u043f\u043b\u043e\u0445\u043e \u0438\u043c\u0435\u0442\u044c \u043f\u0440\u043e\u0441\u0442\u0443\u044e \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u043a\u0443 \u0435\u0433\u043e \u043a\u0430\u0441\u0442\u043e\u043c\u0438\u0437\u0430\u0446\u0438\u0438. \u041a\u0430\u043a \u0431\u044b \u0442\u043e \u043d\u0438 \u0431\u044b\u043b\u043e, \u044d\u0442\u043e \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u0430\u044f \u0431\u043e\u043b\u044c\u0448\u0430\u044f \u0442\u0435\u043c\u0430, \u0438, \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e, \u044f \u0432\u0435\u0440\u043d\u0443\u0441\u044c \u043a \u043d\u0435\u0439 \u0432 \u0434\u0440\u0443\u0433\u043e\u0439 \u0440\u0430\u0437.  <\/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-295792","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/295792","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=295792"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/295792\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=295792"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=295792"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=295792"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}