{"id":310924,"date":"2020-10-04T03:00:15","date_gmt":"2020-10-04T03:00:15","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=310924"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=310924","title":{"rendered":"\u041d\u043e\u0432\u044b\u0439 \u043c\u0435\u0445\u0430\u043d\u0438\u0437\u043c JSX \u0442\u0440\u0430\u043d\u0441\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u0438 \u0432 React 17 Release Candidate"},"content":{"rendered":"\n<div class=\"post__text post__text-html post__text_v1\" id=\"post-content-body\" data-io-article-url=\"https:\/\/habr.com\/ru\/post\/521930\/\">\u0412 React 17 Release Candidate \u043f\u043e\u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u043d\u043e\u0432\u044b\u0439 \u0441\u043f\u043e\u0441\u043e\u0431 \u0442\u0440\u0430\u043d\u0441\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u0438 JSX. \u0421 \u043d\u0438\u043c, \u0432 \u0431\u0430\u043d\u0434\u043b\u0435, \u043d\u0435 \u043f\u043e\u043d\u0430\u0434\u043e\u0431\u0438\u0442\u0441\u044f \u0441\u0430\u043c \u0420\u0435\u0430\u043a\u0442, \u0445\u043e\u0442\u044f \u0434\u043b\u044f \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f \u0445\u0443\u043a\u043e\u0432 \u043e\u043d \u0432\u0441\u0451 \u0435\u0449\u0451 \u043d\u0443\u0436\u0435\u043d. \u042d\u0442\u043e \u0438 \u0435\u0441\u0442\u044c \u043e\u0441\u043d\u043e\u0432\u043d\u043e\u0439 \u0431\u0435\u043d\u0435\u0444\u0438\u0442 \u043d\u043e\u0432\u043e\u0433\u043e \u043c\u0435\u0445\u0430\u043d\u0438\u0437\u043c\u0430. \u041f\u043e\u0434 \u043a\u0430\u0442\u043e\u043c \u043a\u0440\u0430\u0442\u043a\u0438\u0439 \u043f\u0435\u0440\u0435\u0432\u043e\u0434 <a href=\"https:\/\/reactjs.org\/blog\/2020\/09\/22\/introducing-the-new-jsx-transform.html\" rel=\"nofollow\">\u0441\u0442\u0430\u0442\u044c\u0438 \u0432 \u0431\u043b\u043e\u0433\u0435 ReactJS<\/a>.<\/p>\n<p>  <a name=\"habracut\"><\/a><\/p>\n<h3>\u0427\u0442\u043e \u0442\u0430\u043a\u043e\u0435 JSX \u0422\u0440\u0430\u043d\u0441\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044f<\/h3>\n<p>  \u0422\u0430\u043a \u043a\u0430\u043a \u0431\u0440\u0430\u0443\u0437\u0435\u0440\u044b \u043d\u0435 \u043f\u043e\u043d\u0438\u043c\u0430\u044e\u0442 JSX \u201c\u0438\u0437 \u043a\u043e\u0440\u043e\u0431\u043a\u0438\u201d, \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u0438 \u043f\u043e\u043b\u0430\u0433\u0430\u044e\u0442\u0441\u044f \u043d\u0430 \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0442\u043e\u0440\u044b \u0442\u0438\u043f\u0430 Babel \u0438\u043b\u0438 Typescript \u0447\u0442\u043e \u0431\u044b \u0442\u0440\u0430\u043d\u0441\u0444\u043e\u0440\u043c\u0438\u0440\u043e\u0432\u0430\u0442\u044c JSX \u0432 \u043e\u0431\u044b\u0447\u043d\u044b\u0439 JS. <a href=\"https:\/\/reactjs.org\/blog\/2020\/08\/10\/react-v17-rc.html\" rel=\"nofollow\">\u0412 React 17 Release Candidate<\/a> \u043f\u043e\u044f\u0432\u0438\u043b\u0441\u044f \u043d\u043e\u0432\u044b\u0439, \u043e\u043f\u0446\u0438\u043e\u043d\u0430\u043b\u044c\u043d\u044b\u0439 \u043c\u0435\u0445\u0430\u043d\u0438\u0437\u043c \u0442\u0440\u0430\u0441\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u0438 JSX \u0432 JS. <br \/>  \u0412\u043e\u0442 \u0435\u0433\u043e \u043f\u0440\u0435\u0438\u043c\u0443\u0449\u0435\u0441\u0442\u0432\u0430:<\/p>\n<ul>\n<li>\u0418\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435 JSX \u0431\u0435\u0437 \u0438\u043c\u043f\u043e\u0440\u0442\u0430 \u0420\u0435\u0430\u043a\u0442<\/li>\n<li>\u0412 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0438 \u043e\u0442 \u043d\u0430\u0441\u0442\u0440\u043e\u0435\u043a \u0431\u0430\u043d\u0434\u043b \u043c\u043e\u0436\u0435\u0442 \u0441\u043b\u0435\u0433\u043a\u0430 \u0443\u043c\u0435\u043d\u044c\u0448\u0438\u0442\u044c\u0441\u044f<\/li>\n<li>\u0412 \u0431\u0443\u0434\u0443\u0449\u0435\u043c \u0431\u0443\u0434\u0443\u0442 \u0434\u043e\u0441\u0442\u0443\u043f\u043d\u044b \u0444\u0438\u0447\u0438 \u0434\u043b\u044f \u0443\u043f\u0440\u043e\u0449\u0435\u043d\u0438\u044f \u0440\u0430\u0431\u043e\u0442\u044b \u0441 \u0440\u0435\u0430\u043a\u0442\u043e\u043c<\/li>\n<\/ul>\n<p>  (\u0412\u043e\u0437\u043c\u043e\u0436\u043d\u043e \u044f \u043d\u0435 \u0441\u043e\u0432\u0441\u0435\u043c \u0442\u043e\u0447\u043d\u043e \u043f\u0435\u0440\u0435\u0432\u0451\u043b \u2014 \u0432\u043e\u0442 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b: <i>It will enable future improvements that reduce the number of concepts you need to learn React<\/i>)<\/p>\n<p>  \u0410\u043f\u0433\u0440\u0435\u0439\u0434 \u043d\u0438\u043a\u0430\u043a \u043d\u0435 \u043c\u0435\u043d\u044f\u0435\u0442 \u0441\u0430\u043c JSX \u0438 \u0432\u0441\u0435 \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0442\u043e\u0440\u044b \u043a\u0430\u043a \u0440\u0430\u0431\u043e\u0442\u0430\u043b\u0438 \u0442\u0430\u043a \u0438 \u0431\u0443\u0434\u0443\u0442 \u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c. \u041d\u0435\u0442 \u043d\u0438\u043a\u0430\u043a\u0438\u0445 \u043f\u043b\u0430\u043d\u043e\u0432 \u043f\u043e \u043e\u0442\u043a\u0430\u0437\u0443 \u043e\u0442 \u043d\u0438\u0445. \u041f\u043b\u0430\u043d\u0438\u0440\u0443\u0435\u0442\u0441\u044f \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u043a\u0430 \u043d\u043e\u0432\u043e\u0433\u043e \u043c\u0435\u0445\u0430\u043d\u0438\u0437\u043c\u0430 JSX Transform \u0434\u043b\u044f \u0441\u0442\u0430\u0440\u044b\u0445 \u0432\u0435\u0440\u0441\u0438\u0439 \u0420\u0435\u0430\u043a\u0442: 16.\u0445, 15.\u0445, 14.\u0445, \u0432\u043e\u0442 <a href=\"https:\/\/reactjs.org\/blog\/2020\/09\/22\/introducing-the-new-jsx-transform.html#how-to-upgrade-to-the-new-jsx-transform\" rel=\"nofollow\">\u0437\u0434\u0435\u0441\u044c<\/a> \u0438\u043d\u0441\u0442\u0440\u0443\u043a\u0446\u0438\u0438 \u0434\u043b\u044f \u0430\u043f\u0433\u0440\u0435\u0439\u0434\u0430.<\/p>\n<h3>\u0427\u0442\u043e \u0438\u0437\u043c\u0435\u043d\u0438\u043b\u043e\u0441\u044c<\/h3>\n<p>  \u0421\u0442\u0430\u0440\u0430\u044f JSX \u0442\u0440\u0430\u0441\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044f \u0440\u0430\u0431\u043e\u0442\u0430\u043b\u0430 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c:<br \/>  \u041a\u043e\u0434   <\/p>\n<pre><code class=\"javascript\">import React from 'react';  function App() {   return &lt;h1&gt;Hello World&lt;\/h1&gt;; }<\/code><\/pre>\n<p>  \u0422\u0440\u0430\u0441\u0444\u043e\u0440\u043c\u0438\u0440\u043e\u0432\u0430\u043b\u0441\u044f \u0432   <\/p>\n<pre><code class=\"javascript\">import React from 'react';  function App() {   return React.createElement('h1', null, 'Hello world'); } <\/code><\/pre>\n<p>  \u041d\u043e \u044d\u0442\u043e \u043d\u0435 \u0441\u0443\u043f\u0435\u0440 \u0438 \u0432\u043e\u0442 \u043f\u043e\u0447\u0435\u043c\u0443:  <\/p>\n<ul>\n<li>\u0422\u0430\u043a \u043a\u0430\u043a JSX \u043a\u043e\u043c\u043f\u0438\u043b\u0438\u0440\u0443\u0435\u0442\u0441\u044f \u0432 React.createElement, React \u0434\u043e\u043b\u0436\u0435\u043d \u0431\u044b\u0442\u044c \u0432 \u043e\u0431\u043b\u0430\u0441\u0442\u0438 \u0432\u0438\u0434\u0438\u043c\u043e\u0441\u0442\u0438<\/li>\n<li>\u0415\u0441\u0442\u044c <a href=\"https:\/\/github.com\/reactjs\/rfcs\/blob\/createlement-rfc\/text\/0000-create-element-changes.md#motivation\" rel=\"nofollow\">\u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0432\u0430\u0440\u0438\u0430\u043d\u0442\u043e\u0432 \u0443\u043b\u0443\u0447\u0448\u0438\u0442\u044c \u0441\u043a\u043e\u0440\u043e\u0441\u0442\u044c \u0438 \u0443\u043f\u0440\u043e\u0441\u0442\u0438\u0442\u044c<\/a>, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0431\u043b\u043e\u043a\u0438\u0440\u0443\u0435\u0442 React.createElement<\/li>\n<\/ul>\n<p>  \u0427\u0442\u043e \u0431\u044b \u044d\u0442\u043e \u0440\u0435\u0448\u0438\u0442\u044c \u0432 React 17 \u043f\u043e\u044f\u0432\u043b\u044f\u044e\u0442\u0441\u044f \u0434\u0432\u0435 \u043d\u043e\u0432\u044b\u0435 \u0442\u043e\u0447\u043a\u0438 \u0432\u0445\u043e\u0434\u0430 \u043f\u0440\u0435\u0434\u043d\u0430\u0437\u043d\u0430\u0447\u0435\u043d\u043d\u044b\u0435 \u0434\u043b\u044f \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f \u0434\u0440\u0443\u0433\u0438\u043c\u0438 \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442\u0430\u043c\u0438 \u0442\u0430\u043a\u0438\u043c\u0438 \u043a\u0430\u043a Babel \u0438 Typescript \u0438 \u0442\u0435\u043f\u0435\u0440\u044c \u0432\u043c\u0435\u0441\u0442\u043e \u0442\u0440\u0430\u043d\u0441\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u0438 \u0432 React.createElement \u0438\u043c\u043f\u043e\u0440\u0442\u0438\u0440\u0443\u044e\u0442\u0441\u044f \u0438 \u0432\u044b\u0437\u044b\u0432\u0430\u044e\u0442\u0441\u044f \u043d\u043e\u0432\u044b\u0435 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u0438\u0437 \u043f\u0430\u043a\u0435\u0442\u0430 React.<\/p>\n<p>  \u041f\u0440\u0435\u0434\u043f\u043e\u043b\u043e\u0436\u0438\u043c \u0432\u0430\u0448 \u043a\u043e\u0434 \u0432\u044b\u0433\u043b\u044f\u0434\u0435\u043b \u0432\u043e\u0442 \u0442\u0430\u043a:  <\/p>\n<pre><code class=\"javascript\">function App() {   return &lt;h1&gt;Hello World&lt;\/h1&gt;; }<\/code><\/pre>\n<p>  \u041f\u043e\u0441\u043b\u0435 \u043d\u043e\u0432\u043e\u0439 \u0442\u0440\u0430\u043d\u0441\u043e\u0440\u0444\u043c\u0430\u0446\u0438\u0438 \u043e\u043d \u0431\u0443\u0434\u0435\u0442 \u0432\u044b\u0433\u043b\u044f\u0434\u0435\u0442\u044c \u0432\u043e\u0442 \u0442\u0430\u043a:  <\/p>\n<pre><code class=\"javascript\">\/\/ Inserted by a compiler (don't import it yourself!) import {jsx as _jsx} from 'react\/jsx-runtime';  function App() {   return _jsx('h1', { children: 'Hello world' }); }<\/code><\/pre>\n<p>  \u041d\u043e\u0432\u044b\u0439 \u043c\u0435\u0445\u0430\u043d\u0438\u0437\u043c \u043d\u0435 \u0438\u043c\u043f\u043e\u0440\u0442\u0438\u0440\u0443\u0435\u0442 React, \u0445\u043e\u0442\u044f \u043e\u043d \u0432\u0441\u0451 \u0435\u0449\u0451 \u043d\u0443\u0436\u0435\u043d \u0434\u043b\u044f \u0440\u0430\u0431\u043e\u0442\u044b \u0445\u0443\u043a\u043e\u0432.<\/p>\n<p>  \u041d\u043e\u0432\u0430\u044f \u0442\u0440\u0430\u043d\u0441\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044f \u043f\u043e\u043b\u043d\u043e\u0441\u0442\u044c\u044e \u0441\u043e\u0432\u043c\u0435\u0441\u0442\u0438\u043c\u0430 \u0441\u043e \u0432\u0441\u0435\u043c \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u044e\u0449\u0438\u043c JSX \u043a\u043e\u0434\u043e\u043c, \u043d\u0438\u0447\u0435\u0433\u043e \u043c\u0435\u043d\u044f\u0442\u044c \u043d\u0435 \u043f\u0440\u0438\u0434\u0451\u0442\u0441\u044f. \u0412\u043e\u0442 <a href=\"https:\/\/github.com\/reactjs\/rfcs\/blob\/createlement-rfc\/text\/0000-create-element-changes.md#detailed-design\" rel=\"nofollow\">\u0437\u0434\u0435\u0441\u044c<\/a> \u0442\u0435\u0445\u043d\u0438\u0447\u0435\u0441\u043a\u0438\u0435 \u043f\u043e\u0434\u0440\u043e\u0431\u043d\u043e\u0441\u0442\u0438 \u0440\u0430\u0431\u043e\u0442\u044b \u043d\u043e\u0432\u043e\u0439 \u0442\u0440\u0430\u043d\u0441\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u0438 JSX.<\/p>\n<h3>\u041a\u0430\u043a \u0430\u043f\u0433\u0440\u0435\u0439\u0434\u0438\u0442\u044c<\/h3>\n<p>  \u0415\u0441\u043b\u0438 \u043d\u0435 \u0433\u043e\u0442\u043e\u0432\u044b \u0430\u043f\u0433\u0440\u0435\u0439\u0434\u0438\u0442\u044c \u0438\u043b\u0438 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0435 JSX \u0434\u043b\u044f \u0434\u0440\u0443\u0433\u0438\u0445 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a, \u043d\u0435 \u0431\u0435\u0441\u043f\u043e\u043a\u043e\u0439\u0442\u0435\u0441\u044c, \u0441\u0442\u0430\u0440\u0430\u044f \u0442\u0440\u0430\u043d\u0441\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044f \u043d\u0435 \u0431\u0443\u0434\u0435\u0442 \u0443\u0434\u0430\u043b\u0435\u043d\u0430 \u0438 \u0431\u0443\u0434\u0435\u0442 \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u0442\u044c\u0441\u044f.<\/p>\n<p>  \u0414\u043b\u044f \u0430\u043f\u0433\u0440\u0435\u0439\u0434\u0430 \u043d\u0443\u0436\u043d\u044b \u0434\u0432\u0435 \u0432\u0435\u0449\u0438:  <\/p>\n<ul>\n<li>\u0412\u0435\u0440\u0441\u0438\u044f \u0420\u0435\u0430\u043a\u0442 \u0441 \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u043a\u043e\u0439 \u043d\u043e\u0432\u043e\u0439 \u0442\u0440\u0430\u043d\u0441\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u0438. \u041f\u043e\u043a\u0430 \u0447\u0442\u043e \u044d\u0442\u043e \u0442\u043e\u043b\u044c\u043a\u043e 17, \u043d\u043e \u0432 \u0431\u0443\u0434\u0443\u0449\u0435\u043c 16.\u0445, 15.\u0445 \u0438 14.\u0445 <\/li>\n<li>\u0421\u043e\u0432\u043c\u0435\u0441\u0442\u0438\u043c\u044b\u0439 \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0442\u043e\u0440 (\u0441\u043c. \u043d\u0438\u0436\u0435)<\/li>\n<\/ul>\n<p>  <b>Create React App<\/b><br \/>  Create React App \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u043a\u0430 \u0431\u0443\u0434\u0435\u0442 \u0432 <a href=\"https:\/\/gist.github.com\/iansu\/4fab7a9bfa5fa6ebc87a908c62f5340b\" rel=\"nofollow\">\u0440\u0435\u043b\u0438\u0437\u0435 v4.0<\/a> \u0441\u0435\u0439\u0447\u0430\u0441 \u043e\u043d \u0432 \u0431\u0435\u0442\u0430 \u0442\u0435\u0441\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0438 (\u043d\u0430 22.09.20)<\/p>\n<p>  <b>Next.js<\/b><br \/>  Next.js <a href=\"https:\/\/github.com\/vercel\/next.js\/releases\/tag\/v9.5.3\" rel=\"nofollow\">v9.5.3<\/a>+ \u0443\u0436\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442 \u043d\u043e\u0432\u0443\u044e \u0420\u0435\u0430\u043a\u0442 \u0442\u0440\u0430\u043d\u0441\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044e \u0434\u043b\u044f \u0441\u043e\u0432\u043c\u0435\u0441\u0442\u0438\u043c\u044b\u0445 \u0432\u0435\u0440\u0441\u0438\u0439.<\/p>\n<p>  <b>Gatsby<\/b><br \/>  Gatsby <a href=\"https:\/\/github.com\/gatsbyjs\/gatsby\/blob\/master\/packages\/gatsby\/CHANGELOG.md#22452-2020-08-28\" rel=\"nofollow\">v2.24.5<\/a>+ \u0443\u0436\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442 \u043d\u043e\u0432\u0443\u044e \u0420\u0435\u0430\u043a\u0442 \u0442\u0440\u0430\u043d\u0441\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044e \u0434\u043b\u044f \u0441\u043e\u0432\u043c\u0435\u0441\u0442\u0438\u043c\u044b\u0445 \u0432\u0435\u0440\u0441\u0438\u0439.<\/p>\n<div class=\"spoiler\" role=\"button\" tabindex=\"0\">                         <b class=\"spoiler_title\">\u043f\u0440\u0438\u043c\u0435\u0447\u0430\u043d\u0438\u0435<\/b>                         <\/p>\n<div class=\"spoiler_text\">\u0415\u0441\u043b\u0438 \u0443 \u0432\u0430\u0441 \u0432 Gatsby <a href=\"https:\/\/github.com\/gatsbyjs\/gatsby\/issues\/26979\" rel=\"nofollow\">\u0432\u043e\u0442 \u0442\u0430\u043a\u0430\u044f \u043e\u0448\u0438\u0431\u043a\u0430<\/a> \u043f\u043e\u0441\u043b\u0435 \u0430\u043f\u0433\u0440\u0435\u0439\u0434\u0430 \u043d\u0430 17.0.0-rc.2, \u0437\u0430\u043f\u0443\u0441\u0442\u0438\u0442\u0435 npm update  <\/div>\n<\/p><\/div>\n<p>  <b>\u0420\u0443\u0447\u043d\u0430\u044f \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0430 Babel<\/b><br \/>  \u041f\u043e\u0434\u0434\u0435\u0440\u0436\u043a\u0430 \u0441 \u0432\u0435\u0440\u0441\u0438\u0438 <a href=\"https:\/\/babeljs.io\/blog\/2020\/03\/16\/7.9.0\" rel=\"nofollow\">v7.9.0<\/a> \u0438 \u0432\u044b\u0448\u0435<\/p>\n<p>  \u0415\u0441\u043b\u0438 \u0432\u044b \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0435 <a href=\"https:\/\/habr.com\/ru\/users\/babel\/\" class=\"user_link\">babel<\/a>\/plugin-transform-react-jsx:<\/p>\n<p>  # npm<br \/>  <code>npm update @babel\/core @babel\/plugin-transform-react-jsx<\/code><br \/>  # yarn<br \/>  <code>yarn upgrade @babel\/core @babel\/plugin-transform-react-jsx<\/code><\/p>\n<p>  \u0415\u0441\u043b\u0438 \u0432\u044b \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0435 <a href=\"https:\/\/habr.com\/ru\/users\/babel\/\" class=\"user_link\">babel<\/a>\/preset-react:<\/p>\n<p>  # npm<br \/>  <code>npm update @babel\/core @babel\/preset-react<\/code><br \/>  # yarn <br \/>  <code>yarn upgrade @babel\/core @babel\/preset-react<\/code><\/p>\n<p>  \u0421\u0435\u0439\u0447\u0430\u0441 \u0434\u043b\u044f \u0442\u0440\u0430\u043d\u0441\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u0438 JSX, \u0432 <a href=\"https:\/\/habr.com\/ru\/users\/babel\/\" class=\"user_link\">babel<\/a>\/plugin-transform-react-jsx \u0438 \u0432 <a href=\"https:\/\/habr.com\/ru\/users\/babel\/\" class=\"user_link\">babel<\/a>\/preset-react, \u043f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e \u0432\u043a\u043b\u044e\u0447\u0435\u043d\u0430 \u043e\u043f\u0446\u0438\u044f {\u00abruntime\u00bb: \u00abclassic\u00bb} \u044d\u0442\u043e \u0441\u0442\u0430\u0440\u0430\u044f \u0432\u0435\u0440\u0441\u0438\u044f \u0442\u0440\u0430\u043d\u0441\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u0438. \u0414\u043b\u044f \u0432\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u044f \u043d\u043e\u0432\u043e\u0439 \u0442\u0440\u0430\u043d\u0441\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u0438 \u043d\u0443\u0436\u043d\u0430 \u043e\u043f\u0446\u0438\u044f {\u00abruntime\u00bb: \u00abautomatic\u00bb}<\/p>\n<p>  \u0415\u0441\u043b\u0438 \u0432\u044b \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0435 <a href=\"https:\/\/habr.com\/ru\/users\/babel\/\" class=\"user_link\">babel<\/a>\/preset-react  <\/p>\n<pre><code class=\"json\">{   &quot;presets&quot;: [     [&quot;@babel\/preset-react&quot;, {       &quot;runtime&quot;: &quot;automatic&quot;     }]   ] }<\/code><\/pre>\n<p>  \u0415\u0441\u043b\u0438 \u0432\u044b \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0435 <a href=\"https:\/\/habr.com\/ru\/users\/babel\/\" class=\"user_link\">babel<\/a>\/plugin-transform-react-jsx  <\/p>\n<pre><code class=\"json\">{   &quot;plugins&quot;: [     [&quot;@babel\/plugin-transform-react-jsx&quot;, {       &quot;runtime&quot;: &quot;automatic&quot;     }]   ] }<\/code><\/pre>\n<p>  \u041d\u0430\u0447\u0438\u043d\u0430\u044f \u0441 \u0432\u0435\u0440\u0441\u0438\u0438 Babel 8, \u00abautomatic\u00bb \u0431\u0443\u0434\u0435\u0442 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435\u043c \u043f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e \u0434\u043b\u044f \u043e\u0431\u043e\u0438\u0445 \u043f\u043b\u0430\u0433\u0438\u043d\u043e\u0432. \u0412\u043e\u0442 \u0437\u0434\u0435\u0441\u044c \u0431\u043e\u043b\u0435\u0435 \u043f\u043e\u0434\u0440\u043e\u0431\u043d\u0430\u044f \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430\u0446\u0438\u044f <a href=\"https:\/\/babeljs.io\/docs\/en\/babel-plugin-transform-react-jsx\" rel=\"nofollow\">@babel\/plugin-transform-react-jsx<\/a> and <a href=\"https:\/\/babeljs.io\/docs\/en\/babel-preset-react\" rel=\"nofollow\">@babel\/preset-react<\/a>.<\/p>\n<div class=\"spoiler\" role=\"button\" tabindex=\"0\">                         <b class=\"spoiler_title\">\u041f\u0440\u0438\u043c\u0435\u0447\u0430\u043d\u0438\u0435<\/b>                         <\/p>\n<div class=\"spoiler_text\">\u0415\u0441\u043b\u0438 \u0432\u044b \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0435 \u043d\u0435 \u0420\u0435\u0430\u043a\u0442, \u0432\u044b \u043c\u043e\u0436\u0435\u0442\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u043e\u043f\u0446\u0438\u044e importSource \u0434\u043b\u044f \u0438\u043c\u043f\u043e\u0440\u0442\u0430, \u0435\u0441\u043b\u0438 \u043a\u043e\u043d\u0435\u0447\u043d\u043e \u0432\u0430\u0448\u0430 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0430 \u043f\u0440\u0435\u0434\u043e\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u0442 \u0442\u043e\u0447\u043a\u0438 \u0432\u0445\u043e\u0434\u0430. \u0412\u044b \u0442\u0430\u043a \u0436\u0435 \u043c\u043e\u0436\u0435\u0442\u0435 \u043f\u0440\u043e\u0434\u043e\u043b\u0436\u0430\u0442\u044c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u043a\u043b\u0430\u0441\u0441\u0438\u0447\u0435\u0441\u043a\u0443\u044e \u0442\u0440\u0430\u043d\u0441\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044e, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u0431\u0443\u0434\u0435\u0442 \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u0442\u044c\u0441\u044f \u0438 \u0434\u0430\u043b\u044c\u0448\u0435.  <\/div>\n<\/p><\/div>\n<p>  <b>ESLint<\/b><br \/>  \u0415\u0441\u043b\u0438 \u0443 \u0432\u0430\u0441 \u043f\u043b\u0430\u0433\u0438\u043d <a href=\"https:\/\/github.com\/yannickcr\/eslint-plugin-react\" rel=\"nofollow\">eslint-plugin-react<\/a>, \u0442\u043e \u043f\u0440\u0430\u0432\u0438\u043b\u0430 react\/jsx-uses-react \u0438 react\/react-in-jsx-scope \u0431\u043e\u043b\u044c\u0448\u0435 \u043d\u0435 \u043d\u0443\u0436\u043d\u044b \u0438 \u0438\u0445 \u043c\u043e\u0436\u043d\u043e \u0443\u0434\u0430\u043b\u0438\u0442\u044c.<\/p>\n<pre><code class=\"json\">{   \/\/ ...   &quot;rules&quot;: {     \/\/ ...     &quot;react\/jsx-uses-react&quot;: &quot;off&quot;,     &quot;react\/react-in-jsx-scope&quot;: &quot;off&quot;   } }<\/code><\/pre>\n<p>  <b>TypeScript<\/b><br \/>  \u041f\u043e\u0434\u0434\u0435\u0440\u0436\u043a\u0430 JSX \u0442\u0440\u0430\u043d\u0441\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u0438 \u0441 \u0432\u0435\u0440\u0441\u0438\u0438 <a href=\"https:\/\/devblogs.microsoft.com\/typescript\/announcing-typescript-4-1-beta\/#jsx-factories\" rel=\"nofollow\">4.1 beta<\/a>.<\/p>\n<p>  <b>Flow<\/b><br \/>  \u041f\u043e\u0434\u0434\u0435\u0440\u0436\u043a\u0430 JSX \u0442\u0440\u0430\u043d\u0441\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u0438 \u0441 \u0432\u0435\u0440\u0441\u0438\u0438 <a href=\"https:\/\/github.com\/facebook\/flow\/releases\/tag\/v0.126.0\" rel=\"nofollow\">0.126.0<\/a> \u0438 \u0432\u044b\u0448\u0435<\/p>\n<h3>\u041a\u0430\u043a \u0443\u0431\u0440\u0430\u0442\u044c \u043d\u0435\u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c\u044b\u0435 \u0438\u043c\u043f\u043e\u0440\u0442\u044b React<\/h3>\n<p>  \u041f\u043e\u0441\u043a\u043e\u043b\u044c\u043a\u0443 \u043d\u043e\u0432\u0430\u044f JSX \u0442\u0440\u0430\u043d\u0441\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044f \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438 \u0438\u043c\u043f\u043e\u0440\u0442\u0438\u0440\u0443\u0435\u0442 react\/jsx-runtime, React \u0431\u043e\u043b\u044c\u0448\u0435 \u043d\u0435 \u043d\u0443\u0436\u0435\u043d \u0432 \u043e\u0431\u043b\u0430\u0441\u0442\u0438 \u0432\u0438\u0434\u0438\u043c\u043e\u0441\u0442\u0438 \u0434\u043b\u044f \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f JSX. \u041d\u0435\u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c\u044b\u0435 \u0438\u043c\u043f\u043e\u0440\u0442\u044b \u044d\u0442\u043e \u043d\u0435 \u043a\u0440\u0438\u0442\u0438\u0447\u043d\u043e, \u043d\u043e \u0435\u0441\u043b\u0438 \u0445\u043e\u0442\u0438\u0442\u0435 \u0443\u0434\u0430\u043b\u0438\u0442\u044c, \u0440\u0435\u043a\u043e\u043c\u0435\u043d\u0434\u0443\u0435\u0442\u0441\u044f \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0441\u043a\u0440\u0438\u043f\u0442 codemod.  <\/p>\n<pre><code class=\"powershell\">cd your_project npx react-codemod update-react-imports<\/code><\/pre>\n<p>  \u0412 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u0435:  <\/p>\n<ul>\n<li>\u0423\u0434\u0430\u043b\u044f\u0442\u0441\u044f \u0432\u0441\u0435 \u043d\u0435\u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c\u044b\u0435 \u0438\u043c\u043f\u043e\u0440\u0442\u044b React<\/li>\n<li>\u0418\u0437\u043c\u0435\u043d\u044f\u0442\u0441\u044f \u0432\u0441\u0435 \u0438\u043c\u043f\u043e\u0440\u0442\u044b \u0442\u0438\u043f\u0430 import React from \u00abreact\u00bb \u043d\u0430 \u0438\u043c\u0435\u043d\u043e\u0432\u0430\u043d\u043d\u044b\u0435 import { useState } from \u00abreact\u00bb. \u042d\u0442\u043e \u043f\u0440\u0435\u0434\u043f\u043e\u0447\u0442\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u0439 \u0441\u043f\u043e\u0441\u043e\u0431 \u0438\u043c\u043f\u043e\u0440\u0442\u0430. Codemod \u043d\u0435 \u0437\u0430\u0442\u0440\u043e\u043d\u0435\u0442 \u0438\u043c\u043f\u043e\u0440\u0442\u044b \u0442\u0438\u043f\u0430 import * as React from \u00abreact\u00bb, \u044d\u0442\u043e \u0442\u043e\u0436\u0435 \u0432\u0430\u043b\u0438\u0434\u043d\u044b\u0439 \u0438\u043c\u043f\u043e\u0440\u0442 \u0438 \u0432 17 \u0432\u0435\u0440\u0441\u0438\u0438 \u043e\u043d \u0431\u0443\u0434\u0435\u0442 \u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c, \u043d\u043e \u0432 \u0434\u0430\u043b\u044c\u043d\u0435\u0439\u0448\u0435\u043c \u043c\u044b \u0431\u0443\u0434\u0435\u043c \u043f\u0440\u043e\u0441\u0438\u0442\u044c \u0438\u0437\u0431\u0430\u0432\u043b\u044f\u0442\u044c\u0441\u044f \u043e\u0442 \u043d\u0435\u0433\u043e<\/li>\n<\/ul>\n<p>  \u041a\u043e\u0434  <\/p>\n<pre><code class=\"javascript\">import React from 'react';  function App() {   return &lt;h1&gt;Hello World&lt;\/h1&gt;; }<\/code><\/pre>\n<p>  \u0411\u0443\u0434\u0435\u0442 \u0437\u0430\u043c\u0435\u043d\u0451\u043d \u043d\u0430  <\/p>\n<pre><code class=\"javascript\">function App() {   return &lt;h1&gt;Hello World&lt;\/h1&gt;; }<\/code><\/pre>\n<p>  \u0415\u0441\u043b\u0438 \u0432\u044b \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0435 \u0447\u0442\u043e \u0442\u043e \u0434\u0440\u0443\u0433\u043e\u0435 \u0432 \u0440\u0435\u0430\u043a\u0442\u0435 (\u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440 \u0445\u0443\u043a), \u0442\u043e \u0432 \u043a\u043e\u0434\u0435 \u043f\u043e\u044f\u0432\u0438\u0442\u0441\u044f \u0438\u043c\u0435\u043d\u043e\u0432\u0430\u043d\u043d\u044b\u0439 \u0438\u043c\u043f\u043e\u0440\u0442:<br \/>  \u041a\u043e\u0434  <\/p>\n<pre><code class=\"javascript\">import React from 'react';  function App() {   const [text, setText] = React.useState('Hello World');   return &lt;h1&gt;{text}&lt;\/h1&gt;; }<\/code><\/pre>\n<p>  \u0417\u0430\u043c\u0435\u043d\u0438\u0442\u0441\u044f \u043d\u0430 \u043a\u043e\u0434  <\/p>\n<pre><code class=\"javascript\">import { useState } from 'react';  function App() {   const [text, setText] = useState('Hello World');   return &lt;h1&gt;{text}&lt;\/h1&gt;; }<\/code><\/pre>\n<p>  \u0423\u0434\u0430\u043b\u0435\u043d\u0438\u0435 \u043d\u0435\u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c\u043e\u0433\u043e \u0438\u043c\u043f\u043e\u0440\u0442\u0430 \u043f\u043e\u043c\u043e\u0436\u0435\u0442 \u043f\u043e\u0434\u0433\u043e\u0442\u043e\u0432\u0438\u0442\u044c\u0441\u044f \u043a \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u043c \u0432\u0435\u0440\u0441\u0438\u044f\u043c \u0420\u0435\u0430\u043a\u0442\u0430 (\u043d\u0435 17) \u0432 \u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u0431\u0443\u0434\u0435\u0442 \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u043a\u0430 ES \u043c\u043e\u0434\u0443\u043b\u0435\u0439 \u0438 \u043d\u0435 \u0431\u0443\u0434\u0435\u0442 \u0434\u0435\u0444\u043e\u043b\u0442\u043d\u043e\u0433\u043e \u044d\u043a\u0441\u043f\u043e\u0440\u0442\u0430.<\/p>\n<h3>\u0411\u043b\u0430\u0433\u043e\u0434\u0430\u0440\u043d\u043e\u0441\u0442\u0438<\/h3>\n<p>  \u041c\u044b \u0431\u043b\u0430\u0433\u043e\u0434\u0430\u0440\u0438\u043c \u043a\u043e\u043c\u0430\u043d\u0434\u044b Babel, TypeScript, Create React App, Next.js, Gatsby, ESLint, \u0438 Flow \u0437\u0430 \u0438\u0445 \u043f\u043e\u043c\u043e\u0449\u044c \u0432 \u0438\u043d\u0442\u0435\u0433\u0440\u0430\u0446\u0438\u0438 \u043d\u043e\u0432\u043e\u0433\u043e \u043c\u0435\u0445\u0430\u043d\u0438\u0437\u043c\u0430 JSX \u0442\u0440\u0430\u043d\u0441\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u0438. \u041c\u044b \u0442\u0430\u043a\u0436\u0435 \u0431\u043b\u0430\u0433\u043e\u0434\u0430\u0440\u0438\u043c \u0441\u043e\u043e\u0431\u0449\u0435\u0441\u0442\u0432\u043e \u0420\u0435\u0430\u043a\u0442 \u0437\u0430 \u0438\u0445 \u043e\u0442\u0437\u044b\u0432\u044b \u0438 \u043e\u0431\u0441\u0443\u0436\u0434\u0435\u043d\u0438\u044f <a href=\"https:\/\/github.com\/reactjs\/rfcs\/pull\/107\" rel=\"nofollow\">RFC<\/a><\/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=\"https:\/\/habr.com\/ru\/post\/521930\/\"> https:\/\/habr.com\/ru\/post\/521930\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"\n<div class=\"post__text post__text-html post__text_v1\" id=\"post-content-body\" data-io-article-url=\"https:\/\/habr.com\/ru\/post\/521930\/\">\u0412 React 17 Release Candidate \u043f\u043e\u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u043d\u043e\u0432\u044b\u0439 \u0441\u043f\u043e\u0441\u043e\u0431 \u0442\u0440\u0430\u043d\u0441\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u0438 JSX. \u0421 \u043d\u0438\u043c, \u0432 \u0431\u0430\u043d\u0434\u043b\u0435, \u043d\u0435 \u043f\u043e\u043d\u0430\u0434\u043e\u0431\u0438\u0442\u0441\u044f \u0441\u0430\u043c \u0420\u0435\u0430\u043a\u0442, \u0445\u043e\u0442\u044f \u0434\u043b\u044f \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f \u0445\u0443\u043a\u043e\u0432 \u043e\u043d \u0432\u0441\u0451 \u0435\u0449\u0451 \u043d\u0443\u0436\u0435\u043d. \u042d\u0442\u043e \u0438 \u0435\u0441\u0442\u044c \u043e\u0441\u043d\u043e\u0432\u043d\u043e\u0439 \u0431\u0435\u043d\u0435\u0444\u0438\u0442 \u043d\u043e\u0432\u043e\u0433\u043e \u043c\u0435\u0445\u0430\u043d\u0438\u0437\u043c\u0430. \u041f\u043e\u0434 \u043a\u0430\u0442\u043e\u043c \u043a\u0440\u0430\u0442\u043a\u0438\u0439 \u043f\u0435\u0440\u0435\u0432\u043e\u0434 <a href=\"https:\/\/reactjs.org\/blog\/2020\/09\/22\/introducing-the-new-jsx-transform.html\" rel=\"nofollow\">\u0441\u0442\u0430\u0442\u044c\u0438 \u0432 \u0431\u043b\u043e\u0433\u0435 ReactJS<\/a>.<\/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-310924","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/310924","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=310924"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/310924\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=310924"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=310924"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=310924"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}