{"id":258496,"date":"2015-06-02T14:47:02","date_gmt":"2015-06-02T10:47:02","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=258496"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=258496","title":{"rendered":"\u041a\u0430\u043a \u044f \u043f\u0435\u0440\u0435\u0441\u0442\u0430\u043b \u0431\u0435\u0441\u043f\u043e\u043a\u043e\u0438\u0442\u044c\u0441\u044f \u0438 \u043f\u043e\u043b\u044e\u0431\u0438\u043b React"},"content":{"rendered":"<p>             <i>\u041f\u0440\u0435\u0434\u043b\u0430\u0433\u0430\u044e \u0447\u0438\u0442\u0430\u0442\u0435\u043b\u044f\u043c \u00ab\u0425\u0430\u0431\u0440\u0430\u0445\u0430\u0431\u0440\u0430\u00bb \u043f\u0435\u0440\u0435\u0432\u043e\u0434 \u0441\u0442\u0430\u0442\u044c\u0438 <a href=\"http:\/\/firstdoit.com\/react-1\/\">\u00abHow I learned to stop worrying and love React\u00bb<\/a>.<\/i><\/p>\n<p>  \u0415\u0441\u043b\u0438 \u0432\u044b \u0441\u043f\u0440\u043e\u0441\u0438\u0442\u0435 \u043c\u0435\u043d\u044f, \u0447\u0442\u043e \u044f \u0434\u0443\u043c\u0430\u043b \u043e <a href=\"https:\/\/facebook.github.io\/react\/docs\/getting-started.html\">React<\/a> \u0434\u0432\u0430 \u043c\u0435\u0441\u044f\u0446\u0430 \u043d\u0430\u0437\u0430\u0434, \u044f \u0431\u044b \u0441\u043a\u0430\u0437\u0430\u043b\u2026  <\/p>\n<blockquote><p>\u0413\u0434\u0435 \u043c\u043e\u0438 \u0448\u0430\u0431\u043b\u043e\u043d\u044b? \u0427\u0442\u043e \u044d\u0442\u043e\u0442 \u0441\u0443\u043c\u0430\u0441\u0448\u0435\u0434\u0448\u0438\u0439 HTML \u0434\u0435\u043b\u0430\u0435\u0442 \u0432 \u043c\u043e\u0435\u043c JavaScript? JSX \u0432\u044b\u0433\u043b\u044f\u0434\u0438\u0442 \u0441\u0442\u0440\u0430\u043d\u043d\u043e! \u0421\u043a\u043e\u0440\u0435\u0435! \u0421\u0436\u0435\u0447\u044c \u044d\u0442\u043e!<\/p><\/blockquote>\n<p>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/files\/148\/f82\/da0\/148f82da08114e93b044b3c75f9da831.gif\"\/><\/p>\n<p>  \u042d\u0442\u043e \u043f\u043e\u0442\u043e\u043c\u0443, \u0447\u0442\u043e \u044f \u0435\u0433\u043e \u043d\u0435 \u043f\u043e\u043d\u044f\u043b.<\/p>\n<p>  \u041d\u043e \u044f \u0443\u0432\u0435\u0440\u044f\u044e, React \u2014 \u044d\u0442\u043e \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u043d\u043e \u043f\u0440\u0430\u0432\u0438\u043b\u044c\u043d\u044b\u0439 \u043f\u0443\u0442\u044c. \u041f\u043e\u0436\u0430\u043b\u0443\u0439\u0441\u0442\u0430, \u0432\u044b\u0441\u043b\u0443\u0448\u0430\u0439\u0442\u0435 \u043c\u0435\u043d\u044f.<br \/>  <a name=\"habracut\"><\/a>  <\/p>\n<h2>\u0421\u0442\u0430\u0440\u044b\u0439 \u0434\u043e\u0431\u0440\u044b\u0439 MVC<\/h2>\n<p>  \u041a\u043e\u0440\u0435\u043d\u044c \u0437\u043b\u0430 \u0432 \u0438\u043d\u0442\u0435\u0440\u0430\u043a\u0442\u0438\u0432\u043d\u043e\u043c \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0438 \u2014 \u044d\u0442\u043e \u0443\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u0435 \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u0435\u043c. \u00ab\u0422\u0440\u0430\u0434\u0438\u0446\u0438\u043e\u043d\u043d\u044b\u0439\u00bb \u043f\u043e\u0434\u0445\u043e\u0434 \u2014 MVC \u0430\u0440\u0445\u0438\u0442\u0435\u043a\u0442\u0443\u0440\u0430 \u0438\u043b\u0438 \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0435\u0435 \u0432\u0430\u0440\u0438\u0430\u0446\u0438\u0438.<\/p>\n<p>  MVC \u043f\u0440\u0435\u0434\u043f\u043e\u043b\u0430\u0433\u0430\u0435\u0442, \u0447\u0442\u043e \u0432\u0430\u0448\u0430 \u043c\u043e\u0434\u0435\u043b\u044c \u2014 \u044d\u0442\u043e \u0435\u0434\u0438\u043d\u0441\u0442\u0432\u0435\u043d\u043d\u044b\u0439 \u0438\u0441\u0442\u043e\u0447\u043d\u0438\u043a \u0438\u0441\u0442\u0438\u043d\u044b, \u0432\u0441\u0435 \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u0435 \u0436\u0438\u0432\u0435\u0442 \u0442\u0430\u043c. \u041f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u0438\u044f \u2014 \u044d\u0442\u043e \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u043d\u044b\u0435 \u043c\u043e\u0434\u0435\u043b\u0438 \u0438 \u0434\u043e\u043b\u0436\u043d\u044b \u0431\u044b\u0442\u044c \u0441\u0438\u043d\u0445\u0440\u043e\u043d\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u043d\u044b. \u041a\u043e\u0433\u0434\u0430 \u043c\u043e\u0434\u0435\u043b\u044c \u0438\u0437\u043c\u0435\u043d\u044f\u0435\u0442\u0441\u044f \u2014 \u0438\u0437\u043c\u0435\u043d\u044f\u0435\u0442\u0441\u044f \u0438 \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u0438\u0435.<\/p>\n<p>  \u0412 \u0438\u0442\u043e\u0433\u0435 \u0432\u0437\u0430\u0438\u043c\u043e\u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0435 \u0441 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u0435\u043c \u0444\u0438\u043a\u0441\u0438\u0440\u0443\u0435\u0442\u0441\u044f \u043a\u043e\u043d\u0442\u0440\u043e\u043b\u043b\u0435\u0440\u043e\u043c, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043e\u0431\u043d\u043e\u0432\u043b\u044f\u0435\u0442 \u043c\u043e\u0434\u0435\u043b\u044c. \u041f\u043e\u043a\u0430 \u0432\u0441\u0435 \u0445\u043e\u0440\u043e\u0448\u043e.<\/p>\n<p>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/files\/8fc\/d60\/3a4\/8fcd603a4bbf438cb3fe0b637db36424.png\"\/><br \/>  <i>Render \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u0438\u044f \u043f\u0440\u0438 \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u0438 \u043c\u043e\u0434\u0435\u043b\u0438<\/i><\/p>\n<p>  \u042d\u0442\u043e \u0432\u044b\u0433\u043b\u044f\u0434\u0438\u0442 \u0434\u043e\u0432\u043e\u043b\u044c\u043d\u043e \u043f\u0440\u043e\u0441\u0442\u043e. \u0412\u043e-\u043f\u0435\u0440\u0432\u044b\u0445, \u043c\u044b \u0434\u043e\u043b\u0436\u043d\u044b \u043e\u043f\u0438\u0441\u0430\u0442\u044c \u043d\u0430\u0448\u0435 \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u0438\u0435 \u2014 \u043a\u0430\u043a \u043e\u043d\u043e \u043f\u0440\u0435\u043e\u0431\u0440\u0430\u0437\u043e\u0432\u044b\u0432\u0430\u0435\u0442 \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u0435 \u043c\u043e\u0434\u0435\u043b\u0438 \u0432 DOM. \u0417\u0430\u0442\u0435\u043c, \u0432\u0441\u044f\u043a\u0438\u0439 \u0440\u0430\u0437, \u043a\u043e\u0433\u0434\u0430 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c \u0447\u0442\u043e-\u0442\u043e \u0434\u0435\u043b\u0430\u0435\u0442, \u043c\u044b \u043e\u0431\u043d\u043e\u0432\u043b\u044f\u0435\u043c \u043c\u043e\u0434\u0435\u043b\u044c \u0438 \u043f\u0435\u0440\u0435\u0440\u0435\u043d\u0434\u0435\u0440\u0438\u0432\u0430\u0435\u043c \u0432\u0441\u0435. \u0412\u0435\u0440\u043d\u043e? \u041d\u0435 \u0442\u0430\u043a \u0431\u044b\u0441\u0442\u0440\u043e. \u041a \u0441\u043e\u0436\u0430\u043b\u0435\u043d\u0438\u044e, \u0442\u0443\u0442 \u043d\u0435 \u0432\u0441\u0435 \u0433\u043b\u0430\u0434\u043a\u043e. \u041f\u043e 2 \u043f\u0440\u0438\u0447\u0438\u043d\u0430\u043c:<\/p>\n<ol>\n<li> \u0412\u043e\u043e\u0431\u0449\u0435-\u0442\u043e DOM \u0438\u043c\u0435\u0435\u0442 \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u043e\u0435 \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u0435, \u0442\u0430\u043a\u043e\u0435 \u043a\u0430\u043a \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u043c\u043e\u0435 \u0442\u0435\u043a\u0441\u0442\u043e\u0432\u044b\u0445 \u043f\u043e\u043b\u0435\u0439. \u0415\u0441\u043b\u0438 \u0432\u044b \u043f\u0435\u0440\u0435\u0440\u0435\u043d\u0434\u0435\u0440\u0438\u0432\u0430\u0435\u0442\u0435 \u0432\u0430\u0448 DOM \u043f\u043e\u043b\u043d\u043e\u0441\u0442\u044c\u044e, \u0442\u043e \u044d\u0442\u043e \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u043c\u043e\u0435 \u0431\u0443\u0434\u0435\u0442 \u043f\u043e\u0442\u0435\u0440\u044f\u043d\u043e;<\/li>\n<li>DOM \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u0438 (\u0442\u0430\u043a\u0438\u0435 \u043a\u0430\u043a \u0443\u0434\u0430\u043b\u0435\u043d\u0438\u0435 \u0438 \u0432\u0441\u0442\u0430\u0432\u043a\u0430 \u0443\u0437\u043b\u043e\u0432) \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u043c\u0435\u0434\u043b\u0435\u043d\u043d\u044b\u0435. \u041f\u043e\u0441\u0442\u043e\u044f\u043d\u043d\u043e\u0435 \u043f\u0435\u0440\u0435\u0440\u0435\u043d\u0434\u0435\u0440\u0438\u0432\u0430\u043d\u0438\u0435 \u0432\u0441\u0435\u0433\u043e \u0432\u0435\u0434\u0435\u0442 \u043a \u0443\u0436\u0430\u0441\u043d\u043e\u0439 \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u0438.<\/li>\n<\/ol>\n<p>  \u0422\u0430\u043a \u043a\u0430\u043a \u0436\u0435 \u043d\u0430\u043c \u0434\u0435\u0440\u0436\u0430\u0442\u044c \u043c\u043e\u0434\u0435\u043b\u044c \u0438 \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u0438\u044f \u0441\u0438\u043d\u0445\u0440\u043e\u043d\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u043c\u0438 \u0438 \u0438\u0437\u0431\u0435\u0436\u0430\u0442\u044c \u044d\u0442\u0438\u0445 \u043f\u0440\u043e\u0431\u043b\u0435\u043c?<\/p>\n<h2>Data binding<\/h2>\n<p>  \u0417\u0430 \u043f\u043e\u0441\u043b\u0435\u0434\u043d\u0438\u0435 3 \u0433\u043e\u0434\u0430 \u0441\u0430\u043c\u0430\u044f \u0440\u0430\u0441\u043f\u0440\u043e\u0441\u0442\u0440\u0430\u043d\u0435\u043d\u043d\u0430\u044f \u0444\u0438\u0447\u0430 \u0444\u0440\u0435\u0439\u043c\u0432\u043e\u0440\u043a\u043e\u0432, \u0432\u0432\u0435\u0434\u0435\u043d\u043d\u0430\u044f \u0434\u043b\u044f \u0440\u0435\u0448\u0435\u043d\u0438\u044f \u044d\u0442\u0438\u0445 \u043f\u0440\u043e\u0431\u043b\u0435\u043c, \u0431\u044b\u043b\u0430 data binding.<\/p>\n<p>  Data binding \u2014 \u044d\u0442\u043e \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044c \u0434\u0435\u0440\u0436\u0430\u0442\u044c \u0432\u0430\u0448\u0438 \u043c\u043e\u0434\u0435\u043b\u044c \u0438 \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u0438\u044f \u0441\u0438\u043d\u0445\u0440\u043e\u043d\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u043c\u0438 \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438. \u041e\u0431\u044b\u0447\u043d\u043e \u0432 JavaScript \u044d\u0442\u043e \u0432\u0430\u0448\u0438 \u043e\u0431\u044a\u0435\u043a\u0442\u044b \u0438 \u0432\u0430\u0448 DOM.<\/p>\n<p>  \u042d\u0442\u043e \u0434\u043e\u0441\u0442\u0438\u0433\u0430\u0435\u0442\u0441\u044f \u0447\u0435\u0440\u0435\u0437 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044c \u043e\u0431\u044a\u044f\u0432\u0438\u0442\u044c \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0438 \u043c\u0435\u0436\u0434\u0443 \u043a\u0443\u0441\u043a\u0430\u043c\u0438 \u0434\u0430\u043d\u043d\u044b\u0445 \u0432 \u0432\u0430\u0448\u0435\u043c \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0438. \u0418\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u044f \u0432 \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u0438 \u0431\u0443\u0434\u0443\u0442 \u0440\u0430\u0441\u043f\u0440\u043e\u0441\u0442\u0440\u0430\u043d\u044f\u0442\u044c\u0441\u044f \u043f\u043e \u0432\u0441\u0435\u043c\u0443 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044e \u0438 \u0432\u0441\u0435 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0438 \u043e\u0431\u043d\u043e\u0432\u044f\u0442\u0441\u044f \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438.<\/p>\n<p>  \u0414\u0430\u0432\u0430\u0439\u0442\u0435 \u043f\u043e\u0441\u043c\u043e\u0442\u0440\u0438\u043c, \u043a\u0430\u043a \u044d\u0442\u043e \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u043d\u0430 \u043f\u0440\u0430\u043a\u0442\u0438\u043a\u0435 \u0432 \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u0438\u0437\u0432\u0435\u0441\u0442\u043d\u044b\u0445 \u0444\u0440\u0435\u0439\u043c\u0432\u043e\u0440\u043a\u0430\u0445.<\/p>\n<h4> Knockout <\/h4>\n<p>  Knockaut \u0432\u044b\u0441\u0442\u0443\u043f\u0430\u0435\u0442 \u0437\u0430 <a href=\"http:\/\/knockoutjs.com\/documentation\/observables.html\">MVVM (Model-View-ViewModel) \u043f\u043e\u0434\u0445\u043e\u0434<\/a> \u0438 \u043f\u043e\u043c\u043e\u0433\u0430\u0435\u0442 \u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u0442\u044c \u0447\u0430\u0441\u0442\u044c View:<\/p>\n<pre><code class=\"html\"> \/\/ View (a template) &lt;p&gt;First name: &lt;input data-bind=&quot;value: firstName&quot; \/&gt;&lt;\/p&gt;   &lt;p&gt;Last name: &lt;input data-bind=&quot;value: lastName&quot; \/&gt;&lt;\/p&gt;   &lt;h2&gt;Hello, &lt;span data-bind=&quot;text: fullName&quot;&gt; &lt;\/span&gt;!&lt;\/h2&gt; <\/code><\/pre>\n<p>  <\/p>\n<pre><code class=\"javascript\">\/\/ ViewModel (diplay data... and logic?) var ViewModel = function(first, last) {     this.firstName = ko.observable(first);   this.lastName = ko.observable(last);    this.fullName = ko.pureComputed(function() {       \/\/ Knockout tracks dependencies automatically. It knows that fullName depends on firstName and lastName, because these get called when evaluating fullName.       return this.firstName() + &quot; &quot; + this.lastName();   }, this); };  <\/code><\/pre>\n<p>  \u0418, \u0432\u0443\u0430\u043b\u044f. \u0418\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f \u043b\u044e\u0431\u043e\u0433\u043e \u0438\u0437 input \u0431\u0443\u0434\u0435\u0442 \u043f\u0440\u043e\u0432\u043e\u0446\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u0435 \u0432 span. \u0412\u044b \u043d\u0438\u043a\u043e\u0433\u0434\u0430 \u043d\u0435 \u043f\u0438\u0441\u0430\u043b\u0438 \u043a\u043e\u0434 \u0434\u043b\u044f \u0435\u0433\u043e \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u044f. \u041a\u043b\u0430\u0441\u0441\u043d\u043e, \u0434\u0430?<\/p>\n<p>  \u041d\u043e \u043f\u043e\u0434\u043e\u0436\u0434\u0438\u0442\u0435, \u0447\u0442\u043e \u043d\u0430\u0441\u0447\u0435\u0442 \u0442\u043e\u0433\u043e, \u0447\u0442\u043e \u043c\u043e\u0434\u0435\u043b\u044c \u2014 \u044d\u0442\u043e \u0435\u0434\u0438\u043d\u0441\u0442\u0432\u0435\u043d\u043d\u044b\u0439 \u0438\u0441\u0442\u043e\u0447\u043d\u0438\u043a \u0438\u0441\u0442\u0438\u043d\u044b? \u041e\u0442\u043a\u0443\u0434\u0430 ViewModel \u0434\u043e\u043b\u0436\u043d\u0430 \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u0441\u0432\u043e\u0435 \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u0435? \u041e\u0442\u043a\u0443\u0434\u0430 \u043e\u043d\u0430 \u0437\u043d\u0430\u0435\u0442 \u0447\u0442\u043e \u043c\u043e\u0434\u0435\u043b\u044c \u0438\u0437\u043c\u0435\u043d\u0438\u043b\u0430\u0441\u044c? \u0418\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u044b\u0435 \u0432\u043e\u043f\u0440\u043e\u0441\u044b.<\/p>\n<h4>Angular<\/h4>\n<p>  Angular \u043e\u043f\u0438\u0441\u044b\u0432\u0430\u0435\u0442 data binding \u0441 \u0442\u043e\u0447\u043a\u0438 \u0437\u0440\u0435\u043d\u0438\u044f \u0445\u0440\u0430\u043d\u0435\u043d\u0438\u044f \u043c\u043e\u0434\u0435\u043b\u0438 \u0438 \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u0438\u044f \u0441\u0438\u043d\u0445\u0440\u043e\u043d\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u043c\u0438. \u0418\u0437 \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430\u0446\u0438\u0438:<\/p>\n<p>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/files\/f63\/e85\/e47\/f63e85e47d8045719cb81fb6a0d52cc1.png\"\/><\/p>\n<p>  \u041d\u043e\u2026 \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u0438\u0435 \u0434\u043e\u043b\u0436\u043d\u043e \u043e\u0431\u0449\u0430\u0442\u044c\u0441\u044f \u0441 \u043c\u043e\u0434\u0435\u043b\u044c\u044e \u043d\u0430\u043f\u0440\u044f\u043c\u0443\u044e? \u041e\u043d\u0438 \u0442\u0435\u0441\u043d\u043e \u0441\u0432\u044f\u0437\u0430\u043d\u044b?<\/p>\n<p>  \u0412 \u043b\u044e\u0431\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435, \u0434\u0430\u0432\u0430\u0439\u0442\u0435 \u043f\u043e\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u043d\u0430 hello world:<\/p>\n<pre><code class=\"javascript\">\/\/ View (a template)  &lt;div ng-controller=&quot;HelloController as hello&quot;&gt;     &lt;label&gt;Name:&lt;\/label&gt;   &lt;input type=&quot;text&quot; ng-model=&quot;hello.firstName&quot;&gt;   &lt;input type=&quot;text&quot; ng-model=&quot;hello.lastName&quot;&gt;   &lt;h1&gt;Hello {{hello.fullName()}}!&lt;\/h1&gt; &lt;\/div&gt;  \/\/ Controller  angular.module('helloApp', [])   .controller('HelloController', function() {   var hello = this;   hello.fullName = function() {     return hello.firstName + hello.lastName;   }; }); <\/code><\/pre>\n<p>  \u0418\u0437 \u044d\u0442\u043e\u0433\u043e \u043f\u0440\u0438\u043c\u0435\u0440\u0430 \u043f\u043e\u0445\u043e\u0436\u0435, \u0447\u0442\u043e \u043a\u043e\u043d\u0442\u0440\u043e\u043b\u043b\u0435\u0440 \u0438\u043c\u0435\u0435\u0442 \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u0435 \u0438 \u0432\u0435\u0434\u0435\u0442 \u0441\u0435\u0431\u044f \u043a\u0430\u043a \u043c\u043e\u0434\u0435\u043b\u044c, \u0438\u043b\u0438, \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e, \u043a\u0430\u043a ViewModel? \u041f\u0440\u0435\u0434\u043f\u043e\u043b\u0430\u0433\u0430\u044f, \u0447\u0442\u043e \u043c\u043e\u0434\u0435\u043b\u044c \u043d\u0430\u0445\u043e\u0434\u0438\u0442\u0441\u044f \u0432 \u0434\u0440\u0443\u0433\u043e\u043c \u043c\u0435\u0441\u0442\u0435, \u043a\u0430\u043a \u043e\u043d\u0430 \u0441\u0438\u043d\u0445\u0440\u043e\u043d\u0438\u0437\u0438\u0440\u0443\u0435\u0442\u0441\u044f \u0441 \u043a\u043e\u043d\u0442\u0440\u043e\u043b\u043b\u0435\u0440\u043e\u043c?<\/p>\n<p>  \u041c\u043e\u044f \u0433\u043e\u043b\u043e\u0432\u0430 \u043d\u0430\u0447\u0438\u043d\u0430\u0435\u0442 \u043d\u0435\u043c\u043d\u043e\u0433\u043e \u0431\u043e\u043b\u0435\u0442\u044c.<\/p>\n<h2>\u041f\u0440\u043e\u0431\u043b\u0435\u043c\u044b \u0441 data binding<\/h2>\n<p>  Data binding \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u0437\u0430\u043c\u0435\u0447\u0430\u0442\u0435\u043b\u044c\u043d\u043e \u043d\u0430 \u043c\u0430\u043b\u0435\u043d\u044c\u043a\u0438\u0445 \u043f\u0440\u0438\u043c\u0435\u0440\u0430\u0445. \u041e\u0434\u043d\u0430\u043a\u043e \u0432\u043c\u0435\u0441\u0442\u0435 \u0441 \u0442\u0435\u043c, \u043a\u0430\u043a \u0432\u0430\u0448\u0435 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u0440\u0430\u0441\u0442\u0435\u0442, \u0432\u044b, \u0432\u0435\u0440\u043e\u044f\u0442\u043d\u043e, \u0441\u0442\u043e\u043b\u043a\u043d\u0435\u0442\u0435\u0441\u044c \u0441 \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u043c\u0438 \u0438\u0437 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0445 \u043f\u0440\u043e\u0431\u043b\u0435\u043c:<\/p>\n<h4>\u0414\u0435\u043a\u043b\u0430\u0440\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0435\u0439 \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0441\u0442\u0440\u043e \u043f\u0440\u0438\u0432\u0435\u0441\u0442\u0438 \u043a \u0437\u0430\u0446\u0438\u043a\u043b\u0438\u0432\u0430\u043d\u0438\u044e<\/h4>\n<p>  \u041d\u0430\u0438\u0431\u043e\u043b\u0435\u0435 \u0440\u0430\u0441\u043f\u0440\u043e\u0441\u0442\u0440\u0430\u043d\u0435\u043d\u043d\u0430\u044f \u0437\u0430\u0434\u0430\u0447\u0430 \u2014 \u044d\u0442\u043e \u0443\u043f\u0440\u0430\u0432\u0438\u0442\u044c\u0441\u044f \u0441 \u0441\u0430\u0439\u0434-\u044d\u0444\u0444\u0435\u043a\u0442\u0430\u043c\u0438 \u043e\u0442 \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u044f \u0432\u0430\u0448\u0435\u0433\u043e \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u044f. \u042d\u0442\u0430 \u043a\u0430\u0440\u0442\u0438\u043d\u043a\u0430 \u0438\u0437 <a href=\"https:\/\/facebook.github.io\/flux\/docs\/overview.html\">introduction of Flux<\/a> \u0434\u043e\u0432\u043e\u043b\u044c\u043d\u043e \u0447\u0435\u0442\u043a\u043e \u043e\u0431\u044a\u044f\u0441\u043d\u044f\u0435\u0442, \u043a\u0430\u043a \u0430\u0434 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0435\u0439 \u043d\u0430\u0447\u0438\u043d\u0430\u0435\u0442 \u043f\u043e\u0434\u043a\u0440\u0430\u0434\u044b\u0432\u0430\u0442\u044c\u0441\u044f:<\/p>\n<p>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/files\/0f2\/105\/108\/0f21051083df4cda8f79f7993c631d1e.png\"\/><\/p>\n<p>  \u0412 \u044d\u0442\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u043c\u043e\u0436\u0435\u0442\u0435 \u043b\u0438 \u043f\u0440\u0435\u0434\u0441\u043a\u0430\u0437\u0430\u0442\u044c, \u043a\u0430\u043a\u0438\u0435 \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u044f \u043f\u0440\u043e\u0438\u0437\u043e\u0439\u0434\u0443\u0442, \u0435\u0441\u043b\u0438 \u043f\u0440\u043e\u0438\u0437\u043e\u0439\u0434\u0435\u0442 \u043e\u0434\u043d\u043e \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u0435 \u0432 \u043e\u0434\u043d\u043e\u0439 \u043c\u043e\u0434\u0435\u043b\u0438? \u041e\u0447\u0435\u043d\u044c \u0441\u043b\u043e\u0436\u043d\u043e \u0440\u0430\u0441\u0441\u0443\u0436\u0434\u0430\u0442\u044c \u043e \u043a\u043e\u0434\u0435, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d \u0432 \u0441\u043e\u0432\u0435\u0440\u0448\u0435\u043d\u043d\u043e \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u043b\u044c\u043d\u043e\u043c \u043f\u043e\u0440\u044f\u0434\u043a\u0435, \u043a\u043e\u0433\u0434\u0430 \u043b\u044e\u0431\u0430\u044f \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u044c \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0430.<\/p>\n<h4>\u0428\u0430\u0431\u043b\u043e\u043d \u0438 \u043b\u043e\u0433\u0438\u043a\u0430 \u043e\u0442\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u044f \u0438\u0441\u043a\u0443\u0441\u0441\u0442\u0432\u0435\u043d\u043d\u043e \u0440\u0430\u0437\u0434\u0435\u043b\u0435\u043d\u044b<\/h4>\n<p>  \u041a\u0430\u043a\u043e\u0432\u0430 \u0440\u043e\u043b\u044c \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u0438\u044f? \u041f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u0438\u0435 \u0434\u0430\u043d\u043d\u044b\u0445 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044e. \u041a\u0430\u043a\u043e\u0432\u0430 \u0440\u043e\u043b\u044c ViewModel? \u041f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u0438\u0435 \u0434\u0430\u043d\u043d\u044b\u0445 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044e. \u041a\u0430\u043a\u0430\u044f \u0440\u0430\u0437\u043d\u0438\u0446\u0430? \u041d\u0438\u043a\u0430\u043a\u043e\u0439.<\/p>\n<p>  \u0412 \u043a\u043e\u043d\u0446\u0435 \u043a\u043e\u043d\u0446\u043e\u0432, \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442 \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u0438\u044f \u0434\u043e\u043b\u0436\u0435\u043d \u0431\u044b\u0442\u044c \u0441\u043f\u043e\u0441\u043e\u0431\u0435\u043d \u043c\u0430\u043d\u0438\u043f\u0443\u043b\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0441\u0432\u043e\u0438\u043c\u0438 \u0434\u0430\u043d\u043d\u044b\u043c\u0438 \u0438 \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u044f\u0442\u044c \u0438\u0445 \u0432 \u0436\u0435\u043b\u0430\u0435\u043c\u043e\u043c \u0444\u043e\u0440\u043c\u0430\u0442\u0435. \u041e\u0434\u043d\u0430\u043a\u043e \u0432\u0441\u0435 \u044f\u0437\u044b\u043a\u0438 \u0448\u0430\u0431\u043b\u043e\u043d\u043e\u0432 \u043f\u043e \u0441\u0443\u0442\u0438 \u0438\u043d\u0432\u0430\u043b\u0438\u0434\u044b: \u043e\u043d\u0438 \u043d\u0438\u043a\u043e\u0433\u0434\u0430 \u043d\u0435 \u0441\u043c\u043e\u0433\u0443\u0442 \u0434\u043e\u0431\u0438\u0442\u044c\u0441\u044f \u0442\u043e\u0439 \u0436\u0435 \u0432\u044b\u0440\u0430\u0437\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u0438 \u0438 \u0441\u0438\u043b\u044b, \u0447\u0442\u043e \u0438 \u043a\u043e\u0434.<\/p>\n<p>  \u0414\u043e\u0432\u043e\u043b\u044c\u043d\u043e \u043f\u0440\u043e\u0441\u0442\u043e, {{# each}}, ng-repeat \u0438 databind=\u00abforeach\u00bb \u2014 \u044d\u0442\u043e \u0432\u0441\u0435 \u043f\u043b\u043e\u0445\u0430\u044f \u0437\u0430\u043c\u0435\u043d\u0430 \u0434\u043b\u044f \u043d\u0430\u0442\u0438\u0432\u043d\u043e\u0433\u043e \u0438 \u0442\u0440\u0438\u0432\u0438\u0430\u043b\u044c\u043d\u043e\u0433\u043e \u0446\u0438\u043a\u043b\u0430 for \u0432 JavaScript. \u0418 \u043e\u043d\u0438 \u043d\u0435 \u043c\u043e\u0433\u0443\u0442 \u043f\u043e\u0439\u0442\u0438 \u0434\u0430\u043b\u044c\u0448\u0435. \u041d\u0435\u0442 filter \u0438\u043b\u0438 map.<\/p>\n<h4>Data binding \u2014 \u0445\u0430\u043a \u0432\u043e\u043a\u0440\u0443\u0433 \u0440\u0435\u0440\u0435\u043d\u0434\u0435\u0440\u0438\u043d\u0433\u0430<\/h4>\n<p>  \u0421\u0432\u044f\u0442\u043e\u0439 \u0413\u0440\u0430\u0430\u043b\u044c \u043f\u0440\u043e\u0441\u0442\u043e\u0442\u044b \u043d\u0435 \u043e\u0431\u0441\u0443\u0436\u0434\u0430\u0435\u0442\u0441\u044f. \u0412\u0441\u0435 \u0432\u0441\u0435\u0433\u0434\u0430 \u0445\u043e\u0442\u0435\u043b\u0438 \u043f\u0435\u0440\u0435\u0440\u0435\u043d\u0434\u0435\u0440\u0438\u0432\u0430\u0442\u044c \u0432\u0441\u0435 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435, \u043a\u043e\u0433\u0434\u0430 \u043c\u0435\u043d\u044f\u0435\u0442\u0441\u044f \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u0435. \u0422\u0430\u043a\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c, \u043c\u044b \u043c\u043e\u0433\u043b\u0438 \u0431\u044b \u043f\u0435\u0440\u0435\u0441\u0442\u0430\u0442\u044c \u0438\u043c\u0435\u0442\u044c \u0434\u0435\u043b\u043e \u0441 \u043a\u043e\u0440\u043d\u0435\u043c \u0437\u043b\u0430: \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u044f \u043c\u0435\u043d\u044f\u0435\u0442\u0441\u044f \u0441 \u0442\u0435\u0447\u0435\u043d\u0438\u0435\u043c \u0432\u0440\u0435\u043c\u0435\u043d\u0438 \u2014 \u043c\u044b \u043c\u043e\u0433\u043b\u0438 \u0431\u044b \u043f\u0440\u043e\u0441\u0442\u043e \u043e\u043f\u0438\u0441\u0430\u0442\u044c, \u0447\u0442\u043e \u043d\u0430\u0448\u0435 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u0442 \u043a\u0430\u043a\u043e\u0435-\u043b\u044e\u0431\u043e\u0435 \u043a\u043e\u043d\u043a\u0440\u0435\u0442\u043d\u043e\u0435 \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u0435.<\/p>\n<h2>\u0412\u0432\u043e\u0434 React \u043e\u0442 Facebook<\/h2>\n<p>  \u041e\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u0442\u0441\u044f, \u043e\u043d\u0438 \u0441\u0434\u0435\u043b\u0430\u043b\u0438 \u044d\u0442\u043e. React \u0440\u0435\u0430\u043b\u0438\u0437\u0443\u0435\u0442 \u0432\u0438\u0440\u0442\u0443\u0430\u043b\u044c\u043d\u044b\u0439 DOM, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0432\u0440\u043e\u0434\u0435 \u043a\u0430\u043a \u043f\u043e\u0434\u0430\u0435\u0442 \u043d\u0430\u043c \u0421\u0432\u044f\u0442\u043e\u0439 \u0413\u0440\u0430\u0430\u043b\u044c.<\/p>\n<h4>\u0412 \u043b\u044e\u0431\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u0447\u0442\u043e \u0442\u0430\u043a\u043e\u0435 \u0432\u0438\u0440\u0442\u0443\u0430\u043b\u044c\u043d\u044b\u0439 DOM?<\/h4>\n<p>  \u042f \u0440\u0430\u0434, \u0447\u0442\u043e \u0432\u044b \u0441\u043f\u0440\u043e\u0441\u0438\u043b\u0438! \u0414\u0430\u0432\u0430\u0439\u0442\u0435 \u043f\u043e\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u043d\u0430 \u043f\u0440\u043e\u0441\u0442\u043e\u0439 \u043f\u0440\u0438\u043c\u0435\u0440 React.<\/p>\n<pre><code class=\"javascript\">var Hello = React.createClass({       render: function() {         return &lt;div&gt;Hello {this.props.name}&lt;\/div&gt;;     } });  React.render(&lt;Hello name=&quot;World&quot; \/&gt;, document.getElementById('container'));  <\/code><\/pre>\n<p>  \u042d\u0442\u043e \u0432\u0441\u0435 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e\u0435 \u0434\u043b\u044f React \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u0430. \u0412\u044b \u0434\u043e\u043b\u0436\u043d\u044b \u0438\u043c\u0435\u0442\u044c \u043c\u0435\u0442\u043e\u0434 render. \u0421\u043b\u043e\u0436\u043d\u043e, \u0434\u0430?<\/p>\n<p>  \u0425\u043e\u0440\u043e\u0448\u043e, \u043d\u043e \u0447\u0442\u043e \u0437\u0430 &lt;div&gt;? \u042d\u0442\u043e \u043d\u0435 JavaScript! \u0422\u043e\u0447\u043d\u043e \u043d\u0435 \u043e\u043d.<\/p>\n<h4>\u0412\u0430\u0448 \u043d\u043e\u0432\u044b\u0439 \u0434\u0440\u0443\u0433, JSX<\/h4>\n<p>  \u0412\u043e\u043e\u0431\u0449\u0435-\u0442\u043e \u044d\u0442\u043e\u0442 \u043a\u043e\u0434 \u043d\u0430\u043f\u0438\u0441\u0430\u043d \u043d\u0430 JSX. \u0421\u0443\u043f\u0435\u0440 \u043d\u0430\u0431\u043e\u0440 JavaScript, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0432\u043a\u043b\u044e\u0447\u0430\u0435\u0442 \u0432 \u0441\u0435\u0431\u044f \u0441\u0438\u043d\u0442\u0430\u043a\u0441\u0438\u0441 \u0441\u043a\u043e\u0431\u043e\u043a \u0434\u043b\u044f \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u044f \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u043e\u0432. \u041a\u043e\u0434 \u0432\u044b\u0448\u0435, \u043a\u043e\u0433\u0434\u0430 \u0441\u043a\u043e\u043c\u043f\u0438\u043b\u0438\u0440\u0443\u0435\u0442\u0441\u044f \u0432 JavaScript, \u043d\u0430 \u0441\u0430\u043c\u043e\u043c \u0434\u0435\u043b\u0435 \u0441\u0442\u0430\u043d\u0435\u0442 \u0442\u0430\u043a\u0438\u043c:<\/p>\n<pre><code class=\"javascript\">var Hello = React.createClass({displayName: &quot;Hello&quot;,       render: function() {         return React.createElement(&quot;div&quot;, null, &quot;Hello &quot;, this.props.name);     } });  React.render(React.createElement(Hello, {name: &quot;World&quot;}), document.getElementById('container'));   <\/code><\/pre>\n<p>  \u0412\u044b \u0437\u0430\u043c\u0435\u0442\u0438\u043b\u0438 \u0432\u044b\u0437\u043e\u0432\u044b createElement? \u042d\u0442\u0438 \u043e\u0431\u044a\u0435\u043a\u0442\u044b \u0441\u043e\u0441\u0442\u0430\u0432\u043b\u044f\u044e\u0442 \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044e \u0432\u0438\u0440\u0442\u0443\u0430\u043b\u044c\u043d\u043e\u0433\u043e DOM.<\/p>\n<p>  \u0414\u043e\u0432\u043e\u043b\u044c\u043d\u043e \u043f\u0440\u043e\u0441\u0442\u043e: React \u0441\u043d\u0430\u0447\u0430\u043b\u0430 \u0441\u043e\u0431\u0438\u0440\u0430\u0435\u0442 \u0432\u0441\u044e \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0443 \u0432\u0430\u0448\u0435\u0433\u043e \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u0432 \u043f\u0430\u043c\u044f\u0442\u0438, \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044f \u044d\u0442\u0438 \u043e\u0431\u044a\u0435\u043a\u0442\u044b. \u0417\u0430\u0442\u0435\u043c \u043f\u0440\u0435\u043e\u0431\u0440\u0430\u0437\u0443\u0435\u0442 \u044d\u0442\u0443 \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0443 \u0432 \u0430\u043a\u0442\u0443\u0430\u043b\u044c\u043d\u044b\u0435 \u0443\u0437\u043b\u044b DOM \u0438 \u0432\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u0442 \u0438\u0445 \u0432 DOM \u0432\u0430\u0448\u0435\u0433\u043e \u0431\u0440\u0430\u0443\u0437\u0435\u0440\u0430.<\/p>\n<p>  \u0425\u043e\u0440\u043e\u0448\u043e, \u043d\u043e \u043a\u0430\u043a\u043e\u0439 \u0441\u043c\u044b\u0441\u043b \u043f\u0438\u0441\u0430\u0442\u044c \u043d\u0430\u0448 HTML \u0441 \u044d\u0442\u0438\u043c\u0438 \u0441\u0442\u0440\u0430\u043d\u043d\u044b\u043c\u0438 \u0444\u0443\u043d\u043a\u0446\u0438\u044f\u043c\u0438 createElement?<\/p>\n<h4>\u0412\u0438\u0440\u0442\u0443\u0430\u043b\u044c\u043d\u044b\u0439 DOM \u2014 \u0431\u044b\u0441\u0442\u0440\u044b\u0439<\/h4>\n<p>  \u041a\u0430\u043a \u043c\u044b \u0443\u0436\u0435 \u043e\u0431\u0441\u0443\u0436\u0434\u0430\u043b\u0438 \u2014 \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u0438 \u043f\u043e \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u044e DOM \u0434\u043e \u0441\u043c\u0435\u0445\u0430 \u0434\u043e\u0440\u043e\u0433\u043e\u0441\u0442\u043e\u044f\u0449\u0438\u0435, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 DOM \u0434\u043e\u043b\u0436\u0435\u043d \u043c\u0435\u043d\u044f\u0442\u044c\u0441\u044f \u043d\u0430\u0438\u043c\u0435\u043d\u044c\u0448\u0435\u0435 \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u0440\u0430\u0437, \u043d\u0430\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u044d\u0442\u043e \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e.<\/p>\n<p>  \u0412\u0438\u0440\u0442\u0443\u0430\u043b\u044c\u043d\u044b\u0439 DOM \u0432 React, \u043e\u0434\u043d\u0430\u043a\u043e, \u0434\u0435\u043b\u0430\u0435\u0442 \u044d\u0442\u043e \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u0431\u044b\u0441\u0442\u0440\u043e, \u0441\u0440\u0430\u0432\u043d\u0438\u0432\u0430\u044f \u0434\u0432\u0430 \u0434\u0435\u0440\u0435\u0432\u0430 \u0438 \u043d\u0430\u0445\u043e\u0434\u044f \u0438\u043c\u0435\u043d\u043d\u043e \u0442\u043e, \u0447\u0442\u043e \u0438\u0437\u043c\u0435\u043d\u0438\u043b\u043e\u0441\u044c \u043c\u0435\u0436\u0434\u0443 \u043d\u0438\u043c\u0438. \u0422\u0430\u043a\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c React \u0441\u043f\u043e\u0441\u043e\u0431\u0435\u043d \u0432\u044b\u0447\u0438\u0441\u043b\u0438\u0442\u044c \u043c\u0438\u043d\u0438\u043c\u0430\u043b\u044c\u043d\u043e\u0435 \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u0439, \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u044b\u0445 \u0434\u043b\u044f \u043e\u0431\u043d\u043e\u0432\u043b\u0435\u043d\u0438\u044f DOM.<\/p>\n<p>  \u041f\u0440\u0430\u043a\u0442\u0438\u0447\u0435\u0441\u043a\u0438 \u0433\u043e\u0432\u043e\u0440\u044f, React \u043c\u043e\u0436\u0435\u0442 \u0441\u0440\u0430\u0432\u043d\u0438\u0442\u044c \u0434\u0432\u0430 DOM \u0434\u0435\u0440\u0435\u0432\u0430 \u0438 \u0432\u044b\u0447\u0438\u0441\u043b\u0438\u0442\u044c \u043c\u0438\u043d\u0438\u043c\u0430\u043b\u044c\u043d\u044b\u0439 \u043d\u0430\u0431\u043e\u0440 \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u0439, \u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u043d\u0443\u0436\u043d\u043e \u0432\u044b\u043f\u043e\u043b\u043d\u0438\u0442\u044c. \u042d\u0442\u043e \u043e\u0437\u043d\u0430\u0447\u0430\u0435\u0442 \u0434\u0432\u0435 \u0432\u0435\u0449\u0438:<\/p>\n<ol>\n<li>\u0415\u0441\u043b\u0438 \u0442\u0435\u043a\u0441\u0442\u043e\u0432\u044b\u0435 \u043f\u043e\u043b\u044f \u0441 \u0442\u0435\u043a\u0441\u0442\u043e\u043c \u043f\u0435\u0440\u0435\u0440\u0435\u043d\u0434\u0435\u0440\u0438\u0432\u0430\u044e\u0442\u0441\u044f \u0442\u043e React \u043e\u0436\u0438\u0434\u0430\u0435\u0442, \u0447\u0442\u043e \u0435\u0441\u0442\u044c \u043a\u043e\u043d\u0442\u0435\u043d\u0442 \u0438 \u043d\u0435 \u0431\u0443\u0434\u0435\u0442 \u043a\u0430\u0441\u0430\u0442\u044c\u0441\u044f \u0435\u0433\u043e. \u041d\u0435\u0442 \u0431\u043e\u043b\u044c\u0448\u0435 \u043f\u043e\u0442\u0435\u0440\u0438 \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u044f;<\/li>\n<li>\u0421\u0440\u0430\u0432\u043d\u0435\u043d\u0438\u0435 \u0432\u0438\u0440\u0442\u0443\u0430\u043b\u044c\u043d\u044b\u0445 DOM \u0441\u043e\u0432\u0441\u0435\u043c \u043d\u0435 \u0434\u043e\u0440\u043e\u0433\u043e, \u0442\u0430\u043a \u0447\u0442\u043e \u043c\u044b \u043c\u043e\u0436\u0435\u043c \u0441\u0440\u0430\u0432\u043d\u0438\u0432\u0430\u0442\u044c \u0438\u0445 \u0441\u0442\u043e\u043b\u044c\u043a\u043e \u0441\u043a\u043e\u043b\u044c\u043a\u043e \u043d\u0430\u043c \u043d\u0440\u0430\u0432\u0438\u0442\u0441\u044f. \u041a\u043e\u0433\u0434\u0430 diff \u0433\u043e\u0442\u043e\u0432, \u0447\u0442\u043e\u0431\u044b \u043d\u0430 \u0441\u0430\u043c\u043e\u043c \u0434\u0435\u043b\u0435 \u0438\u0437\u043c\u0435\u043d\u0438\u0442\u044c DOM \u043e\u043d \u0441\u0434\u0435\u043b\u0430\u0435\u0442 \u044d\u0442\u043e \u043c\u0438\u043d\u0438\u043c\u0430\u043b\u044c\u043d\u044b\u043c \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e\u043c \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u0439. \u041d\u0435\u0442 \u0431\u043e\u043b\u044c\u0448\u0435 \u043c\u0435\u0434\u043b\u0435\u043d\u043d\u043e\u0433\u043e \u043c\u0430\u043a\u0435\u0442\u0430.<\/li>\n<\/ol>\n<p>  \u0412\u043e\u0441\u043f\u043e\u043c\u0438\u043d\u0430\u043d\u0438\u0435 \u043e 2 \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u0430\u0445 \u0441 \u043f\u0435\u0440\u0435\u0440\u0435\u043d\u0434\u0435\u0440\u0438\u0432\u0430\u043d\u0438\u0435\u043c \u0446\u0435\u043b\u043e\u0433\u043e \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u043f\u0440\u0438 \u0441\u043c\u0435\u043d\u0435 \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u044f?<\/p>\n<p>  \u041f\u0440\u043e\u0448\u043b\u043e.<\/p>\n<h4>React \u043c\u0430\u043f\u0438\u0442 \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u0435 \u0432 DOM<\/h4>\n<p>  Virtual DOM rendering \u0438 diffing \u2014 \u044d\u0442\u043e \u0435\u0434\u0438\u043d\u0441\u0442\u0432\u0435\u043d\u043d\u0430\u044f \u043c\u0430\u0433\u0438\u0447\u0435\u0441\u043a\u0430\u044f \u0447\u0430\u0441\u0442\u044c React. \u0415\u0433\u043e \u043e\u0442\u043b\u0438\u0447\u043d\u0430\u044f \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u044c \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u043d\u0430\u043c \u0438\u043c\u0435\u0442\u044c \u0433\u043e\u0440\u0430\u0437\u0434\u043e \u0431\u043e\u043b\u0435\u0435 \u043f\u0440\u043e\u0441\u0442\u0443\u044e \u0430\u0440\u0445\u0438\u0442\u0435\u043a\u0442\u0443\u0440\u0443. \u041d\u0430\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u043f\u0440\u043e\u0441\u0442\u0443\u044e?  <\/p>\n<blockquote><p>React \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u044b \u2014 \u044d\u0442\u043e \u0438\u0434\u0435\u043c\u043f\u043e\u0442\u0435\u043d\u0442\u043d\u044b\u0435 \u0444\u0443\u043d\u043a\u0446\u0438\u0438. \u041e\u043d\u0438 \u043e\u043f\u0438\u0441\u044b\u0432\u0430\u044e\u0442 \u0432\u0430\u0448 UI \u0432 \u043b\u044e\u0431\u043e\u0439 \u043c\u043e\u043c\u0435\u043d\u0442 \u0432\u0440\u0435\u043c\u0435\u043d\u0438. \u041f\u0440\u043e\u0441\u0442\u043e \u043a\u0430\u043a \u043e\u0442\u0440\u0435\u043d\u0434\u0435\u0440\u0435\u043d\u043e\u0435 \u043d\u0430 \u0441\u0435\u0440\u0432\u0435\u0440\u0435 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435.  <\/p><\/blockquote>\n<p>  <i>Pete Hunt, <a href=\"https:\/\/www.youtube.com\/watch?v=x7cQ3mrcKaY\">React: Rethinking best practices<\/a><br \/>  <\/i><br \/>  \u042d\u0442\u043e \u0432\u0441\u0435, \u043a\u0430\u043a\u0438\u043c React \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442 \u0434\u043e\u043b\u0436\u0435\u043d \u0431\u044b\u0442\u044c \u043d\u0430 \u0441\u0430\u043c\u043e\u043c \u0434\u0435\u043b\u0435. \u041e\u043d \u043e\u0442\u043e\u0431\u0440\u0430\u0436\u0430\u0435\u0442 \u0442\u0435\u043a\u0443\u0449\u0435\u0435 \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u0435 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u0432 DOM. \u0423 \u0432\u0430\u0441 \u0435\u0441\u0442\u044c \u0432\u0441\u044f \u043c\u043e\u0449\u044c JavaScript \u0434\u043b\u044f \u043e\u043f\u0438\u0441\u0430\u043d\u0438\u044f \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u0441\u043a\u043e\u0433\u043e \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441\u0430: \u0446\u0438\u043a\u043b\u044b, \u0444\u0443\u043d\u043a\u0446\u0438\u0438, \u0441\u043a\u043e\u0443\u043f\u044b, \u043a\u043e\u043c\u043f\u043e\u0437\u0438\u0446\u0438\u0438, \u043f\u043e\u043b\u043d\u043e\u0446\u0435\u043d\u043d\u044b\u0439 \u044f\u0437\u044b\u043a \u0448\u0430\u0431\u043b\u043e\u043d\u043e\u0432.<\/p>\n<pre><code class=\"javascript\">var CommentList = React.createClass({     render: function() {     var commentNodes = this.props.data.map(function (comment) {       return (         &lt;Comment author={comment.author}&gt;           {comment.text}         &lt;\/Comment&gt;       );     });     return (       &lt;div className=&quot;commentList&quot;&gt;         {commentNodes}       &lt;\/div&gt;     );   } });  var CommentBox = React.createClass({     render: function() {     return (       &lt;div className=&quot;commentBox&quot;&gt;         &lt;h1&gt;Comments&lt;\/h1&gt;         &lt;CommentList data={this.props.data} \/&gt;       &lt;\/div&gt;     );   } });  React.render(     &lt;CommentBox data={data} \/&gt;,   document.getElementById('content') ); <\/code><\/pre>\n<p>  <\/p>\n<h4>\u041d\u0430\u0447\u043d\u0438\u0442\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c React \u0441\u0435\u0433\u043e\u0434\u043d\u044f<\/h4>\n<p>  \u041d\u0430 \u043f\u0435\u0440\u0432\u044b\u0439 \u0432\u0437\u0433\u043b\u044f\u0434, React \u043c\u043e\u0436\u0435\u0442 \u043f\u043e\u043a\u0430\u0437\u0430\u0442\u044c\u0441\u044f \u043d\u0435\u043c\u043d\u043e\u0433\u043e \u0441\u043b\u043e\u0436\u043d\u044b\u043c. \u041e\u043d \u043f\u0440\u0435\u0434\u043b\u0430\u0433\u0430\u0435\u0442 \u043e\u0447\u0435\u043d\u044c \u0431\u043e\u043b\u044c\u0448\u0438\u0435 \u043f\u0430\u0440\u0430\u0434\u0438\u0433\u043c\u044b, \u0447\u0442\u043e \u0432\u0441\u0435\u0433\u0434\u0430 \u043d\u0435 \u0443\u0434\u043e\u0431\u043d\u043e. \u041e\u0434\u043d\u0430\u043a\u043e, \u043a\u043e\u0433\u0434\u0430 \u0432\u044b \u043d\u0430\u0447\u0438\u043d\u0430\u0435\u0442\u0435 \u0435\u0433\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u2014 \u043f\u0440\u0435\u0438\u043c\u0443\u0449\u0435\u0441\u0442\u0432\u0430 \u0441\u0442\u0430\u043d\u043e\u0432\u044f\u0442\u0441\u044f \u043f\u043e\u043d\u044f\u0442\u043d\u044b.<\/p>\n<p>  <a href=\"https:\/\/facebook.github.io\/react\/docs\/getting-started.html\">\u0414\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430\u0446\u0438\u044f<\/a> \u0443 React \u043f\u0440\u0435\u0432\u043e\u0441\u0445\u043e\u0434\u043d\u0430\u044f. \u0412\u044b \u0434\u043e\u043b\u0436\u043d\u044b \u043f\u043e\u043f\u0440\u043e\u0431\u043e\u0432\u0430\u0442\u044c \u0435\u0433\u043e \u0438 \u0441\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u044c \u0442\u0443\u0442\u043e\u0440\u0438\u0430\u043b\u0443. \u042f \u0443\u0432\u0435\u0440\u0435\u043d, \u0447\u0442\u043e \u0432\u044b \u043f\u043e\u043b\u044e\u0431\u0438\u0442\u0435 React, \u0435\u0441\u043b\u0438 \u0434\u0430\u0434\u0438\u0442\u0435 \u0435\u043c\u0443 \u0448\u0430\u043d\u0441.<\/p>\n<p>  \u0425\u043e\u0440\u043e\u0448\u0435\u0433\u043e \u043a\u043e\u0434\u0438\u043d\u0433\u0430.<\/p>\n<p>  \u041e\u0440\u0438\u0433\u0438\u043d\u0430\u043b \u0441\u0442\u0430\u0442\u044c\u0438: <a href=\"http:\/\/firstdoit.com\/react-1\/\">How I learned to stop worrying and love React<\/a><br \/>  \u0410\u0432\u0442\u043e\u0440 \u0441\u0442\u0430\u0442\u044c\u0438: <a href=\"http:\/\/firstdoit.com\/about\/\">Guilherme Rodrigues<\/a>             <\/p>\n<div class=\"clear\"><\/div>\n<p> \u0441\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b \u0441\u0442\u0430\u0442\u044c\u0438 <a href=\"http:\/\/habrahabr.ru\/post\/259349\/\"> http:\/\/habrahabr.ru\/post\/259349\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>             <i>\u041f\u0440\u0435\u0434\u043b\u0430\u0433\u0430\u044e \u0447\u0438\u0442\u0430\u0442\u0435\u043b\u044f\u043c \u00ab\u0425\u0430\u0431\u0440\u0430\u0445\u0430\u0431\u0440\u0430\u00bb \u043f\u0435\u0440\u0435\u0432\u043e\u0434 \u0441\u0442\u0430\u0442\u044c\u0438 <a href=\"http:\/\/firstdoit.com\/react-1\/\">\u00abHow I learned to stop worrying and love React\u00bb<\/a>.<\/i><\/p>\n<p>  \u0415\u0441\u043b\u0438 \u0432\u044b \u0441\u043f\u0440\u043e\u0441\u0438\u0442\u0435 \u043c\u0435\u043d\u044f, \u0447\u0442\u043e \u044f \u0434\u0443\u043c\u0430\u043b \u043e <a href=\"https:\/\/facebook.github.io\/react\/docs\/getting-started.html\">React<\/a> \u0434\u0432\u0430 \u043c\u0435\u0441\u044f\u0446\u0430 \u043d\u0430\u0437\u0430\u0434, \u044f \u0431\u044b \u0441\u043a\u0430\u0437\u0430\u043b\u2026  <\/p>\n<blockquote><p>\u0413\u0434\u0435 \u043c\u043e\u0438 \u0448\u0430\u0431\u043b\u043e\u043d\u044b? \u0427\u0442\u043e \u044d\u0442\u043e\u0442 \u0441\u0443\u043c\u0430\u0441\u0448\u0435\u0434\u0448\u0438\u0439 HTML \u0434\u0435\u043b\u0430\u0435\u0442 \u0432 \u043c\u043e\u0435\u043c JavaScript? JSX \u0432\u044b\u0433\u043b\u044f\u0434\u0438\u0442 \u0441\u0442\u0440\u0430\u043d\u043d\u043e! \u0421\u043a\u043e\u0440\u0435\u0435! \u0421\u0436\u0435\u0447\u044c \u044d\u0442\u043e!<\/p><\/blockquote>\n<p>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/files\/148\/f82\/da0\/148f82da08114e93b044b3c75f9da831.gif\"\/><\/p>\n<p>  \u042d\u0442\u043e \u043f\u043e\u0442\u043e\u043c\u0443, \u0447\u0442\u043e \u044f \u0435\u0433\u043e \u043d\u0435 \u043f\u043e\u043d\u044f\u043b.<\/p>\n<p>  \u041d\u043e \u044f \u0443\u0432\u0435\u0440\u044f\u044e, React \u2014 \u044d\u0442\u043e \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u043d\u043e \u043f\u0440\u0430\u0432\u0438\u043b\u044c\u043d\u044b\u0439 \u043f\u0443\u0442\u044c. \u041f\u043e\u0436\u0430\u043b\u0443\u0439\u0441\u0442\u0430, \u0432\u044b\u0441\u043b\u0443\u0448\u0430\u0439\u0442\u0435 \u043c\u0435\u043d\u044f.  <\/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-258496","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/258496","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=258496"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/258496\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=258496"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=258496"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=258496"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}