{"id":281831,"date":"2016-12-01T12:00:03","date_gmt":"2016-12-01T09:00:03","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=281831"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=281831","title":{"rendered":"React.js \u043d\u0430 \u0440\u0443\u0441\u0441\u043a\u043e\u043c \u044f\u0437\u044b\u043a\u0435. \u0427\u0430\u0441\u0442\u044c \u0448\u0435\u0441\u0442\u0430\u044f"},"content":{"rendered":"<p><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/files\/934\/498\/326\/93449832696b4abfac3c0864352642ad.jpg\"\/><\/p>\n<p>  \u041f\u0435\u0440\u0435\u0432\u043e\u0434 \u043e\u0444\u0438\u0446\u0438\u0430\u043b\u044c\u043d\u043e\u0439 \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430\u0446\u0438\u0438 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438 React.js \u043d\u0430 \u0440\u0443\u0441\u0441\u043a\u043e\u043c \u044f\u0437\u044b\u043a\u0435.<\/p>\n<h3>\u041e\u0433\u043b\u0430\u0432\u043b\u0435\u043d\u0438\u0435:<\/h3>\n<p>  1 \u2014 <a href=\"https:\/\/habrahabr.ru\/post\/315466\/\">\u0427\u0430\u0441\u0442\u044c \u043f\u0435\u0440\u0432\u0430\u044f<\/a> <br \/>  2 \u2014 <a href=\"https:\/\/habrahabr.ru\/post\/315630\/\">\u0427\u0430\u0441\u0442\u044c \u0432\u0442\u043e\u0440\u0430\u044f<\/a><br \/>  3 \u2014 <a href=\"https:\/\/habrahabr.ru\/post\/315716\/\">\u0427\u0430\u0441\u0442\u044c \u0442\u0440\u0435\u0442\u044c\u044f<\/a><br \/>  4 \u2014 <a href=\"https:\/\/habrahabr.ru\/post\/315922\/\">\u0427\u0430\u0441\u0442\u044c \u0447\u0435\u0442\u0432\u0435\u0440\u0442\u0430\u044f<\/a><br \/>  5 \u2014 <a href=\"https:\/\/habrahabr.ru\/post\/316262\/\">\u0427\u0430\u0441\u0442\u044c \u043f\u044f\u0442\u0430\u044f<\/a><br \/>  6 \u2014 \u0427\u0430\u0441\u0442\u044c \u0448\u0435\u0441\u0442\u0430\u044f<br \/>  7 \u2014 \u0427\u0430\u0441\u0442\u044c \u0441\u0435\u0434\u044c\u043c\u0430\u044f (\u0441\u043a\u043e\u0440\u043e)<\/p>\n<h1>\u041e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0430 \u0441\u043e\u0431\u044b\u0442\u0438\u0439<\/h1>\n<p>  \u041e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0430 \u0441\u043e\u0431\u044b\u0442\u0438\u0439 \u0441 \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u0430\u043c\u0438 <i>React<\/i> \u043e\u0447\u0435\u043d\u044c \u0441\u0445\u043e\u0436\u0430 \u0441 \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u043e\u0439 \u0441\u043e\u0431\u044b\u0442\u0438\u0439 \u0441 \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u0430\u043c\u0438 <i>DOM<\/i>.<br \/>  \u0421\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u0435\u0442 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0441\u0438\u043d\u0442\u0430\u043a\u0441\u0438\u0447\u0435\u0441\u043a\u0438\u0445 \u0440\u0430\u0437\u043b\u0438\u0447\u0438\u0439:<br \/>  \u041d\u0430\u0437\u0432\u0430\u043d\u0438\u044f \u0441\u043e\u0431\u044b\u0442\u0438\u0439 <i>React<\/i> \u0441\u043e\u0437\u0434\u0430\u044e\u0442\u0441\u044f \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e <i>camelCase<\/i>, \u0430 \u043d\u0435 <i>lowercase<\/i>.<br \/>  \u0421 <i>JSX<\/i> \u0432\u044b \u043f\u0435\u0440\u0435\u0434\u0430\u0435\u0442\u0435 \u0444\u0443\u043d\u043a\u0446\u0438\u044e \u043a\u0430\u043a \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a \u0441\u043e\u0431\u044b\u0442\u0438\u044f, \u0430 \u043d\u0435 \u0441\u0442\u0440\u043e\u043a\u0443.<br \/>  \u041d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, HTML:  <\/p>\n<pre><code class=\"javascript\">&lt;button onclick=&quot;activateLasers()&quot;&gt;   Activate Lasers &lt;\/button&gt; <\/code><\/pre>\n<p>  \u0412 <i>React<\/i> \u044d\u0442\u043e \u0432\u044b\u0433\u043b\u044f\u0434\u0438\u0442 \u043d\u0435\u043c\u043d\u043e\u0433\u043e \u043f\u043e-\u0434\u0440\u0443\u0433\u043e\u043c\u0443:<br \/>  <a name=\"habracut\"><\/a>  <\/p>\n<pre><code class=\"javascript\">&lt;button onClick={activateLasers}&gt;   Activate Lasers &lt;\/button&gt; <\/code><\/pre>\n<p>  \u0415\u0449\u0435 \u043e\u0434\u043d\u043e \u043e\u0442\u043b\u0438\u0447\u0438\u0435 \u0437\u0430\u043a\u043b\u044e\u0447\u0430\u0435\u0442\u0441\u044f \u0432 \u0442\u043e\u043c, \u0447\u0442\u043e \u0432 <i>React<\/i> \u0412\u044b \u043d\u0435 \u043c\u043e\u0436\u0435\u0442\u0435 \u0432\u0435\u0440\u043d\u0443\u0442\u044c <i>false<\/i> \u043a \u043f\u0440\u0435\u0434\u044b\u0434\u0443\u0449\u0435\u043c\u0443 \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u044e \u043f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e. \u042f\u0432\u043d\u043e \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c <i>preventDefault<\/i>. \u041d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u043e\u0431\u044b\u0447\u043d\u043e\u0433\u043e <i>HTML<\/i>, \u0447\u0442\u043e\u0431\u044b \u043f\u0440\u0435\u0434\u043e\u0442\u0432\u0440\u0430\u0442\u0438\u0442\u044c \u043f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e \u043e\u0442\u043a\u0440\u044b\u0442\u0438\u0435 \u043f\u043e \u0441\u0441\u044b\u043b\u043a\u0435 \u043d\u043e\u0432\u043e\u0439 \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u044b, \u0432\u044b \u043c\u043e\u0436\u0435\u0442\u0435 \u043d\u0430\u043f\u0438\u0441\u0430\u0442\u044c:  <\/p>\n<pre><code class=\"javascript\">&lt;a href=&quot;#&quot; onclick=&quot;console.log('The link was clicked.'); return false&quot;&gt;   Click me &lt;\/a&gt; <\/code><\/pre>\n<p>  \u0412 React \u044d\u0442\u043e \u0431\u0443\u0434\u0435\u0442 \u0432\u044b\u0433\u043b\u044f\u0434\u0435\u0442\u044c \u0442\u0430\u043a:  <\/p>\n<pre><code class=\"javascript\">function ActionLink() {   function handleClick(e) {     e.preventDefault();     console.log('The link was clicked.');   }    return (     &lt;a href=&quot;#&quot; onClick={handleClick}&gt;       Click me     &lt;\/a&gt;   ); } <\/code><\/pre>\n<p>  \u0417\u0434\u0435\u0441\u044c <i>e<\/i> \u044d\u0442\u043e \u0441\u0438\u043d\u0442\u0435\u0442\u0438\u0447\u0435\u0441\u043a\u043e\u0435 \u0441\u043e\u0431\u044b\u0442\u0438\u0435. React \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u044f\u0435\u0442 \u0442\u0430\u043a\u0438\u0435 \u0441\u0438\u043d\u0442\u0435\u0442\u0438\u0447\u0435\u0441\u043a\u0438\u0435 \u0441\u043e\u0431\u044b\u0442\u0438\u044f \u0441\u043e\u0433\u043b\u0430\u0441\u043d\u043e <a href=\"https:\/\/www.w3.org\/TR\/DOM-Level-3-Events\/\">W3C spec<\/a> \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u0432\u0430\u043c \u043d\u0435 \u0441\u0442\u043e\u0438\u0442 \u0431\u0435\u0441\u043f\u043e\u043a\u043e\u0438\u0442\u044c\u0441\u044f \u043e \u043a\u0440\u043e\u0441\u0441-\u0431\u0440\u0430\u0443\u0437\u0435\u0440\u043d\u043e\u0439 \u0441\u043e\u0432\u043c\u0435\u0441\u0442\u0438\u043c\u043e\u0441\u0442\u0438.<\/p>\n<p>  \u041a\u0430\u043a \u043f\u0440\u0430\u0432\u0438\u043b\u043e, \u043f\u0440\u0438 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0438 <i>React<\/i>, \u0432\u0430\u043c \u043d\u0435 \u043d\u0443\u0436\u043d\u043e \u043e\u0442\u0441\u044b\u043b\u0430\u0442\u044c \u0441\u0438\u0433\u043d\u0430\u043b \u043a <i>addEventListener<\/i>, \u0447\u0442\u043e\u0431\u044b \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u0438 \u0441\u043e\u0431\u044b\u0442\u0438\u0439 \u043a <i>DOM<\/i> \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u0443 \u043f\u043e\u0441\u043b\u0435 \u0435\u0433\u043e \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f. \u0412\u043c\u0435\u0441\u0442\u043e \u044d\u0442\u043e\u0433\u043e, \u043f\u0440\u043e\u0441\u0442\u043e \u0432\u044b\u043f\u043e\u043b\u043d\u0438\u0442\u0435 \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a \u043a\u043e\u0433\u0434\u0430 \u044d\u043b\u0435\u043c\u0435\u043d\u0442 \u0432\u043f\u0435\u0440\u0432\u044b\u0435 \u043e\u0442\u043e\u0431\u0440\u0430\u0436\u0430\u0435\u0442\u0441\u044f.<\/p>\n<p>  \u041a\u043e\u0433\u0434\u0430 \u0432\u044b \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u044f\u0435\u0442\u0435 \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442, \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044f \u043a\u043b\u0430\u0441\u0441 <i>ES6<\/i>, \u043e\u0431\u0449\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u0446\u043e\u043c \u0434\u043b\u044f \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u0430 \u0441\u043e\u0431\u044b\u0442\u0438\u0439 \u0438 \u0431\u0443\u0434\u0435\u0442 \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c\u043e\u043c \u043a\u043b\u0430\u0441\u0441\u0430. \u041d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442 <i>Toggle<\/i> \u043e\u0442\u043e\u0431\u0440\u0430\u0436\u0430\u0435\u0442 \u043a\u043d\u043e\u043f\u043a\u0443, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f\u043c \u0432\u044b\u0431\u0438\u0440\u0430\u0442\u044c \u043c\u0435\u0436\u0434\u0443 \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u044f\u043c\u0438 \u00abON\u00bb \u0438 \u00abOFF\u00bb:  <\/p>\n<pre><code class=\"javascript\">class Toggle extends React.Component {   constructor(props) {     super(props);     this.state = {isToggleOn: true};      \/\/ This binding is necessary to make `this` work in the callback     this.handleClick = this.handleClick.bind(this);   }    handleClick() {     this.setState(prevState =&gt; ({       isToggleOn: !prevState.isToggleOn     }));   }    render() {     return (       &lt;button onClick={this.handleClick}&gt;         {this.state.isToggleOn ? 'ON' : 'OFF'}       &lt;\/button&gt;     );   } }  ReactDOM.render(   &lt;Toggle \/&gt;,   document.getElementById('root') ); <\/code><\/pre>\n<p>  \u041f\u043e\u043f\u0440\u043e\u0431\u0443\u0439\u0442\u0435 \u043f\u043e\u0432\u0442\u043e\u0440\u0438\u0442\u044c \u044d\u0442\u043e\u0442 \u043f\u0440\u0438\u043c\u0435\u0440 \u0432 <a href=\"http:\/\/codepen.io\/gaearon\/pen\/xEmzGg?editors=0010\">CodePen<\/a>.<\/p>\n<p>  \u0411\u0443\u0434\u044c\u0442\u0435 \u043e\u0441\u0442\u043e\u0440\u043e\u0436\u043d\u044b \u0441 \u044d\u0442\u0438\u043c\u0438 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f\u043c\u0438 \u0432 \u043e\u0431\u0440\u0430\u0442\u043d\u044b\u0445 \u0441\u0438\u0433\u043d\u0430\u043b\u0430\u0445 <i>JSX<\/i>. \u041a\u043b\u0430\u0441\u0441\u043e\u0432\u044b\u0435 \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c\u044b \u043d\u0435 \u0441\u0432\u044f\u0437\u0430\u043d\u044b \u043f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e. \u0415\u0441\u043b\u0438 \u0432\u044b \u0437\u0430\u0431\u044b\u043b\u0438 \u0441\u0432\u044f\u0437\u0430\u0442\u044c \u0438\u0445, \u0432\u044b\u043f\u043e\u043b\u043d\u0438\u0442\u0435 <i>this.handleClick<\/i> \u0438 \u043f\u0435\u0440\u0435\u0434\u0430\u0439\u0442\u0435 \u0435\u0433\u043e \u043d\u0430 <i>onClick<\/i>. <i>This<\/i> \u0441\u0442\u0430\u043d\u0435\u0442 <i>undefined<\/i> \u043a\u043e\u0433\u0434\u0430 \u0444\u0443\u043d\u043a\u0446\u0438\u044f \u043f\u043e\u043b\u0443\u0447\u0438\u0442 \u0441\u0438\u0433\u043d\u0430\u043b.<\/p>\n<p>  \u0422\u0430\u043a\u043e\u0435 \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0435 \u043d\u0435\u0442\u0438\u043f\u0438\u0447\u043d\u043e \u0434\u043b\u044f <i>React<\/i>, \u043e\u043d\u043e \u043e\u0442\u043d\u043e\u0441\u0438\u0442\u0441\u044f \u043a \u0440\u0430\u0431\u043e\u0442\u0435 \u0444\u0443\u043d\u043a\u0446\u0438\u0439 \u0432 JavaScript. \u0412 \u043e\u0441\u043d\u043e\u0432\u043d\u043e\u043c, \u0435\u0441\u043b\u0438 \u0432\u044b \u043e\u0431\u0440\u0430\u0449\u0430\u0435\u0442\u0435\u0441\u044c \u043a \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c\u0443 \u0431\u0435\u0437 () \u043f\u043e\u0441\u043b\u0435 \u043d\u0435\u0433\u043e, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440 \u043a\u0430\u043a <i>onClick={this.handleClick}<\/i>, \u0432\u044b \u0434\u043e\u043b\u0436\u043d\u044b \u0441\u0432\u044f\u0437\u0430\u0442\u044c \u0434\u0430\u043d\u043d\u044b\u0439 \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c.<\/p>\n<p>  \u0415\u0441\u043b\u0438 \u0432\u044b \u043d\u0435 \u0445\u043e\u0442\u0438\u0442\u0435 \u043e\u0442\u043f\u0440\u0430\u0432\u043b\u044f\u0442\u044c \u0441\u0438\u0433\u043d\u0430\u043b\u044b \u0432 <i>bind<\/i>, \u0442\u043e \u0435\u0441\u0442\u044c \u0435\u0449\u0435 \u0434\u0432\u0430 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u044b\u0445 \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u044f. \u0415\u0441\u043b\u0438 \u0432\u044b \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0435 \u044d\u043a\u0441\u043f\u0435\u0440\u0438\u043c\u0435\u043d\u0442\u0430\u043b\u044c\u043d\u044b\u0439 \u043f\u043b\u0430\u0433\u0438\u043d <a href=\"https:\/\/babeljs.io\/docs\/plugins\/transform-class-properties\/\">property initializer syntax<\/a>, \u0442\u043e \u0432\u044b \u043c\u043e\u0436\u0435\u0442\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0438\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0430\u0442\u043e\u0440\u044b \u0440\u0435\u0430\u043b\u0438\u0437\u0443\u0435\u043c\u044b\u0445 \u0441\u0432\u043e\u0439\u0441\u0442\u0432, \u0447\u0442\u043e\u0431\u044b \u043f\u0440\u0430\u0432\u0438\u043b\u044c\u043d\u043e \u0441\u0432\u044f\u0437\u0430\u0442\u044c \u043e\u0431\u0440\u0430\u0442\u043d\u044b\u0435 \u0432\u044b\u0437\u043e\u0432\u044b:  <\/p>\n<pre><code class=\"javascript\">class LoggingButton extends React.Component {   \/\/ This syntax ensures `this` is bound within handleClick.   \/\/ Warning: this is *experimental* syntax.   handleClick = () =&gt; {     console.log('this is:', this);   }    render() {     return (       &lt;button onClick={this.handleClick}&gt;         Click me       &lt;\/button&gt;     );   } } <\/code><\/pre>\n<p>  \u0414\u0430\u043d\u043d\u044b\u0439 \u0441\u0438\u043d\u0442\u0430\u043a\u0441\u0438\u0441 \u0432 <a href=\"https:\/\/github.com\/facebookincubator\/create-react-app\">Create React App<\/a> \u0432\u043a\u043b\u044e\u0447\u0435\u043d \u043f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e.<br \/>  \u0415\u0441\u043b\u0438 \u0432\u044b \u043d\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0435 \u0438\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0430\u0442\u043e\u0440\u044b \u0441\u0432\u043e\u0439\u0441\u0442\u0432, \u0432\u044b \u043c\u043e\u0436\u0435\u0442\u0435 \u043f\u0440\u0438\u043c\u0435\u043d\u0438\u0442\u044c \u0441\u0442\u0440\u0435\u043b\u043e\u0447\u043d\u0443\u044e \u0444\u0443\u043d\u043a\u0446\u0438\u044e (<i>arrow function<\/i>) \u0432 \u043e\u0431\u0440\u0430\u0442\u043d\u044b\u0445 \u0441\u0438\u0433\u043d\u0430\u043b\u043e\u0432:  <\/p>\n<pre><code class=\"javascript\">class LoggingButton extends React.Component {   handleClick() {     console.log('this is:', this);   }    render() {     \/\/ This syntax ensures `this` is bound within handleClick     return (       &lt;button onClick={(e) =&gt; this.handleClick(e)}&gt;         Click me       &lt;\/button&gt;     );   } } <\/code><\/pre>\n<p>  \u041f\u0440\u043e\u0431\u043b\u0435\u043c\u0430 \u0441 \u0442\u0430\u043a\u0438\u043c \u0441\u0438\u043d\u0442\u0430\u043a\u0441\u0438\u0441\u043e\u043c \u0441\u043e\u0441\u0442\u043e\u0438\u0442 \u0432 \u0442\u043e\u043c, \u0447\u0442\u043e \u0434\u0440\u0443\u0433\u043e\u0439 \u043e\u0431\u0440\u0430\u0442\u043d\u044b\u0439 \u0441\u0438\u0433\u043d\u0430\u043b \u0441\u043e\u0437\u0434\u0430\u0435\u0442\u0441\u044f \u043a\u0430\u0436\u0434\u044b\u0439 \u0440\u0430\u0437, \u043a\u043e\u0433\u0434\u0430 \u0432\u044b\u0432\u043e\u0434\u0438\u0442\u0441\u044f <i>LoggingButton<\/i>. \u0427\u0430\u0449\u0435 \u0432\u0441\u0435\u0433\u043e, \u044d\u0442\u043e \u043d\u043e\u0440\u043c\u0430\u043b\u044c\u043d\u043e\u0435 \u044f\u0432\u043b\u0435\u043d\u0438\u0435. \u041e\u0434\u043d\u0430\u043a\u043e \u0435\u0441\u043b\u0438 \u043e\u0431\u0440\u0430\u0442\u043d\u044b\u0435 \u0441\u0438\u0433\u043d\u0430\u043b\u044b \u043f\u0435\u0440\u0435\u0434\u0430\u044e\u0442\u0441\u044f \u043a\u0430\u043a \u0441\u0432\u043e\u0439\u0441\u0442\u0432\u0430 \u0434\u043b\u044f \u043d\u0438\u0436\u043d\u0438\u0445 \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u043e\u0432, \u0442\u043e \u0442\u0430\u043a\u0438\u0435 \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u044b \u043c\u043e\u0433\u0443\u0442 \u043f\u0440\u043e\u0438\u0437\u0432\u0435\u0441\u0442\u0438 \u043f\u043e\u0432\u0442\u043e\u0440\u043d\u043e\u0435 \u0434\u0435\u043c\u043e\u043d\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435. \u0427\u0430\u0449\u0435 \u0432\u0441\u0435\u0433\u043e, \u043c\u044b \u0441\u043e\u0432\u0435\u0442\u0443\u0435\u043c \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442\u044c \u0441\u0432\u044f\u0437\u044b\u0432\u0430\u043d\u0438\u0435 \u0432 \u043a\u043e\u043d\u0441\u0442\u0440\u0443\u043a\u0442\u043e\u0440\u0435, \u0447\u0442\u043e\u0431\u044b \u0438\u0437\u0431\u0435\u0436\u0430\u0442\u044c \u043f\u043e\u0434\u043e\u0431\u043d\u044b\u0445 \u043f\u0440\u043e\u0431\u043b\u0435\u043c \u0441 \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u044c\u044e.<br \/> \u0441\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b \u0441\u0442\u0430\u0442\u044c\u0438 <a href=\"https:\/\/habrahabr.ru\/post\/316600\/\"> https:\/\/habrahabr.ru\/post\/316600\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/files\/934\/498\/326\/93449832696b4abfac3c0864352642ad.jpg\"\/><\/p>\n<p>  \u041f\u0435\u0440\u0435\u0432\u043e\u0434 \u043e\u0444\u0438\u0446\u0438\u0430\u043b\u044c\u043d\u043e\u0439 \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430\u0446\u0438\u0438 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438 React.js \u043d\u0430 \u0440\u0443\u0441\u0441\u043a\u043e\u043c \u044f\u0437\u044b\u043a\u0435.<\/p>\n<h3>\u041e\u0433\u043b\u0430\u0432\u043b\u0435\u043d\u0438\u0435:<\/h3>\n<p>  1 \u2014 <a href=\"https:\/\/habrahabr.ru\/post\/315466\/\">\u0427\u0430\u0441\u0442\u044c \u043f\u0435\u0440\u0432\u0430\u044f<\/a> <br \/>  2 \u2014 <a href=\"https:\/\/habrahabr.ru\/post\/315630\/\">\u0427\u0430\u0441\u0442\u044c \u0432\u0442\u043e\u0440\u0430\u044f<\/a><br \/>  3 \u2014 <a href=\"https:\/\/habrahabr.ru\/post\/315716\/\">\u0427\u0430\u0441\u0442\u044c \u0442\u0440\u0435\u0442\u044c\u044f<\/a><br \/>  4 \u2014 <a href=\"https:\/\/habrahabr.ru\/post\/315922\/\">\u0427\u0430\u0441\u0442\u044c \u0447\u0435\u0442\u0432\u0435\u0440\u0442\u0430\u044f<\/a><br \/>  5 \u2014 <a href=\"https:\/\/habrahabr.ru\/post\/316262\/\">\u0427\u0430\u0441\u0442\u044c \u043f\u044f\u0442\u0430\u044f<\/a><br \/>  6 \u2014 \u0427\u0430\u0441\u0442\u044c \u0448\u0435\u0441\u0442\u0430\u044f<br \/>  7 \u2014 \u0427\u0430\u0441\u0442\u044c \u0441\u0435\u0434\u044c\u043c\u0430\u044f (\u0441\u043a\u043e\u0440\u043e)<\/p>\n<h1>\u041e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0430 \u0441\u043e\u0431\u044b\u0442\u0438\u0439<\/h1>\n<p>  \u041e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0430 \u0441\u043e\u0431\u044b\u0442\u0438\u0439 \u0441 \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u0430\u043c\u0438 <i>React<\/i> \u043e\u0447\u0435\u043d\u044c \u0441\u0445\u043e\u0436\u0430 \u0441 \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u043e\u0439 \u0441\u043e\u0431\u044b\u0442\u0438\u0439 \u0441 \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u0430\u043c\u0438 <i>DOM<\/i>.<br \/>  \u0421\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u0435\u0442 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0441\u0438\u043d\u0442\u0430\u043a\u0441\u0438\u0447\u0435\u0441\u043a\u0438\u0445 \u0440\u0430\u0437\u043b\u0438\u0447\u0438\u0439:<br \/>  \u041d\u0430\u0437\u0432\u0430\u043d\u0438\u044f \u0441\u043e\u0431\u044b\u0442\u0438\u0439 <i>React<\/i> \u0441\u043e\u0437\u0434\u0430\u044e\u0442\u0441\u044f \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e <i>camelCase<\/i>, \u0430 \u043d\u0435 <i>lowercase<\/i>.<br \/>  \u0421 <i>JSX<\/i> \u0432\u044b \u043f\u0435\u0440\u0435\u0434\u0430\u0435\u0442\u0435 \u0444\u0443\u043d\u043a\u0446\u0438\u044e \u043a\u0430\u043a \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a \u0441\u043e\u0431\u044b\u0442\u0438\u044f, \u0430 \u043d\u0435 \u0441\u0442\u0440\u043e\u043a\u0443.<br \/>  \u041d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, HTML:  <\/p>\n<pre><code class=\"javascript\">&lt;button onclick=&quot;activateLasers()&quot;&gt;   Activate Lasers &lt;\/button&gt; <\/code><\/pre>\n<p>  \u0412 <i>React<\/i> \u044d\u0442\u043e \u0432\u044b\u0433\u043b\u044f\u0434\u0438\u0442 \u043d\u0435\u043c\u043d\u043e\u0433\u043e \u043f\u043e-\u0434\u0440\u0443\u0433\u043e\u043c\u0443:  <\/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-281831","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/281831","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=281831"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/281831\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=281831"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=281831"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=281831"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}