{"id":293344,"date":"2019-08-14T03:00:24","date_gmt":"2019-08-14T03:00:24","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=293344"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=293344","title":{"rendered":"\u0418\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435 Context API \u0432 React \u0434\u043b\u044f \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f \u0430\u0434\u0430\u043f\u0442\u0438\u0432\u043d\u043e\u0433\u043e \u0434\u0438\u0437\u0430\u0439\u043d\u0430 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f"},"content":{"rendered":"\n<div class=\"post__text post__text-html js-mediator-article\">\u041f\u0440\u0438\u0432\u0435\u0442, \u0434\u0430\u043d\u043d\u0430\u044f \u0441\u0442\u0430\u0442\u044c\u044f \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u043f\u0440\u043e\u0434\u043e\u043b\u0436\u0435\u043d\u0438\u0435\u043c <a href=\"https:\/\/habr.com\/ru\/post\/462963\/\">\u0432\u043e\u0442 \u044d\u0442\u043e\u0433\u043e \u043f\u043e\u0441\u0442\u0430<\/a>, \u0433\u0434\u0435 \u044f \u0440\u0435\u0448\u0438\u043b \u043d\u0430\u0447\u0430\u0442\u044c \u0441\u0435\u0440\u0438\u044e \u043d\u0435\u0431\u043e\u043b\u044c\u0448\u0438\u0445 \u0443\u0447\u0435\u0431\u043d\u044b\u0445 \u043f\u043e\u0441\u043e\u0431\u0438\u0439 \u043f\u043e \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044e UI-Kit. \u0422\u0430\u043c \u043e\u043f\u0438\u0441\u0430\u043d \u043c\u0435\u0442\u043e\u0434 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f \u043a\u043e\u043d\u0442\u0435\u043a\u0441\u0442\u0430 \u0434\u043b\u044f \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f \u0442\u0435\u043c\u044b \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f. \u0421\u0435\u0433\u043e\u0434\u043d\u044f \u044f \u0445\u043e\u0447\u0443 \u0434\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u044c \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u0435\u0449\u0435 \u043e\u0434\u043d\u0438\u043c \u043a\u043e\u043d\u0442\u0435\u043a\u0441\u0442\u043e\u043c, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043f\u043e\u043c\u043e\u0436\u0435\u0442 \u043d\u0430\u043c \u043f\u043e\u043a\u0430\u0437\u044b\u0432\u0430\u0442\u044c \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u044b UI, \u043e\u0441\u043d\u043e\u0432\u044b\u0432\u0430\u044f\u0441\u044c \u043d\u0430 \u0434\u0438\u0432\u0430\u0439\u0441\u0435 \u044e\u0437\u0435\u0440\u0430.<\/p>\n<p>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/post_images\/a07\/487\/f45\/a07487f45ea98d589cc8af25e7d011af.jpg\" alt=\"image\"><br \/>  <a name=\"habracut\"><\/a><br \/>  \u0412 \u0434\u0430\u043d\u043d\u043e\u043c \u043f\u0440\u0438\u043c\u0435\u0440\u0435 \u044f \u0442\u0430\u043a\u0436\u0435 \u0431\u0443\u0434\u0443 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u043c\u043e\u0434\u0443\u043b\u044c <code>create-react-context<\/code>.<\/p>\n<p>  \u0414\u0435\u0440\u0435\u0432\u043e \u0437\u0430\u0434\u0430\u043d\u0438\u044f \u0431\u0443\u0434\u0435\u0442 \u0438\u0434\u0435\u043d\u0442\u0438\u0447\u043d\u044b\u043c \u0441 \u043f\u0440\u0435\u0434\u044b\u0434\u0443\u0449\u0438\u043c. \u041d\u0430\u0437\u043e\u0432\u0435\u043c \u043d\u043e\u0432\u0443\u044e \u043f\u0430\u043f\u043a\u0443 <b>media-context<\/b>.<\/p>\n<pre><code class=\"markdown\">media-context\/    MediaConsumer\/       MediaConsumer.js       index.js     MediaProvider\/       MediaProvider.js       index.js   constants.js    context.js   index.js <\/code><\/pre>\n<p>  \u0411\u044b\u0441\u0442\u0440\u0435\u043d\u044c\u043a\u043e \u0440\u0430\u0437\u0431\u0435\u0440\u0435\u043c\u0441\u044f \u0441 <b>index&#8217;\u0430\u043c\u0438<\/b>.<\/p>\n<p>  <b>media-context\/index.js<\/b>  <\/p>\n<pre><code class=\"javascript\">export { MediaProvider } from '.\/MediaProvider'; export { MediaConsumer } from '.\/MediaConsumer'; <\/code><\/pre>\n<p>  <b>theme-context\/MediaConsumer\/index.js<\/b>  <\/p>\n<pre><code class=\"javascript\">export { MediaConsumer } from '.\/MediaConsumer'; <\/code><\/pre>\n<p>  <b>theme-context\/MediaProvider\/index.js<\/b>  <\/p>\n<pre><code class=\"javascript\">export { MediaProvider } from '.\/MediaProvider'; <\/code><\/pre>\n<p>  <b>theme-context\/context.js<\/b><br \/>  \u041a\u0430\u043a \u0438 \u0440\u0430\u043d\u0435\u0435, \u0441\u043e\u0437\u0434\u0430\u0435\u043c <code>createContext<\/code> (<a href=\"https:\/\/www.npmjs.com\/package\/create-react-context\">\u043c\u043e\u0434\u0443\u043b\u044c \u043d\u043f\u043c<\/a>).<\/p>\n<pre><code class=\"javascript\">import createContext from 'create-react-context';  const { Provider, Consumer } = createContext();  export { Provider, Consumer }; <\/code><\/pre>\n<p>  \u0418\u043c\u043f\u043e\u0440\u0442\u0438\u0440\u0443\u0435\u043c, \u0434\u0435\u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0438\u0440\u0443\u0435\u043c \u0438 \u044d\u043a\u0441\u043f\u043e\u0440\u0442\u0438\u0440\u0443\u0435\u043c \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u043d\u044b\u0435 \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u044b.<\/p>\n<p>  <b>media-context\/constants.js<\/b><br \/>  \u041f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0435 \u0441\u043e\u0445\u0440\u0430\u043d\u0438\u043c \u0442\u0443\u0442.<\/p>\n<pre><code class=\"javascript\">export const devices = [\"mobile\", \"tablet\", \"desktop\", \"native\"]; export const defaultDevice = \"mobile\"; <\/code><\/pre>\n<p>  \u0412 \u0430\u0434\u0430\u043f\u0442\u0438\u0432\u043d\u043e\u043c \u043f\u043e\u0434\u0445\u043e\u0434\u0435 \u044e\u0437\u0435\u0440 \u0432 \u043e\u0441\u043d\u043e\u0432\u043d\u043e\u043c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442 4 \u0432\u0438\u0434\u0430 \u0434\u0438\u0432\u0430\u0439\u0441\u043e\u0432 \u2014 \u043d\u0430\u0441\u0442\u043e\u043b\u044c\u043d\u044b\u0439, \u043f\u043b\u0430\u043d\u0448\u0435\u0442, \u043c\u043e\u0431\u0438\u043b\u044c\u043d\u044b\u0439 \u0438 \u043d\u0430\u0442\u0438\u0432\u043d\u043e\u0435 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 (native). \u0414\u0440\u0443\u0433\u0438\u0435 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u044b\u0435 \u0443\u0441\u0442\u0440\u043e\u0439\u0441\u0442\u0432\u0430: \u0441\u043c\u0430\u0440\u0442-\u0442\u0432, \u0447\u0430\u0441\u044b \u0438 \u0442.\u043f. \u0412 \u0434\u0430\u043d\u043d\u043e\u043c \u043f\u0440\u0438\u043c\u0435\u0440\u0435 \u0431\u0443\u0434\u0435\u043c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0442\u043e\u043b\u044c\u043a\u043e <i>mobile &amp; desktop<\/i>.<\/p>\n<p>  <b>theme-context\/MediaProvider\/MediaProvider.js<\/b><br \/>  \u041a\u0430\u043a \u043c\u044b \u0443\u0436\u0435 \u0437\u043d\u0430\u0435\u043c, \u0432 <code>React.Context<\/code> \u0434\u043e\u0441\u0442\u0443\u043f\u0435\u043d Provider, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u00ab\u043a\u043e\u0440\u043c\u0438\u0442\u00bb \u043a\u043e\u043d\u0441\u044e\u043c\u0435\u0440\u043e\u0432 \u043a\u043e\u043d\u0442\u0435\u043a\u0441\u0442\u043e\u043c. \u041e\u043d \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u0438\u043c \u0441\u043b\u0443\u0448\u0430\u0442\u044c \u0438 \u0440\u0435\u0430\u0433\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u043d\u0430 \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u044f \u043a\u043e\u043d\u0442\u0435\u043a\u0441\u0442\u0430.<\/p>\n<p>  Props <code>\u041f\u0440\u043e\u0432\u0430\u0439\u0434\u0435\u0440\u0430<\/code> \u2014 <code>device<\/code> \u0438 <code>touchable<\/code>. \u041d\u0430\u043f\u043e\u043c\u043d\u044e, \u0447\u0442\u043e \u0432\u0441\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f \u043f\u0435\u0440\u0435\u0434\u0430\u043d\u043d\u044b\u0435 \u0432 <code>value<\/code> \u043f\u0440\u043e\u0432\u0430\u0439\u0434\u0435\u0440\u0430 \u0441\u0442\u0430\u043d\u0443\u0442 \u0434\u043e\u0441\u0442\u0443\u043f\u043d\u044b\u043c\u0438 \u0434\u043b\u044f \u043a\u043e\u043d\u0441\u044e\u043c\u0435\u0440\u043e\u0432. <\/p>\n<pre><code class=\"javascript\">import React from \"react\"; import PropTypes from \"prop-types\";  import { Provider } from \"..\/context\"; import { devices, defaultDevice } from \"..\/constanst\";  function MediaProvider(props) {   const device = devices.includes(props.device)     ? props.device     : props.defaultDevice;   return &lt;Provider value={{ ...props, device }}&gt;{props.children}&lt;\/Provider&gt;; }  MediaProvider.propTypes = {   device: PropTypes.oneOf(devices),   touchable: false,   children: PropTypes.node };  MediaProvider.defaultProps = {   device: defaultDevice,   touchable: false };  export { MediaProvider }; <\/code><\/pre>\n<p>  <b>theme-context\/MediaConsumer\/MediaConsumer.js<\/b><\/p>\n<p>  \u041e\u043f\u0438\u0441\u0430\u043d\u0438\u0435 \u0444\u0443\u043d\u043a\u0446\u0438\u043e\u043d\u0430\u043b\u044c\u043d\u043e\u0441\u0442\u0438 \u043a\u043e\u043d\u0441\u044e\u043c\u0435\u0440\u0430 \u043c\u043e\u0436\u043d\u043e \u043d\u0430\u0439\u0442\u0438 \u0432 \u043f\u0440\u0435\u0434\u044b\u0434\u0443\u0449\u0435\u0439 \u0441\u0442\u0430\u0442\u044c\u0435, \u043d\u043e \u0435\u0441\u043b\u0438 \u0432\u043a\u0440\u0430\u0442\u0446\u0435, \u0442\u043e <code>Consumer<\/code> \u0440\u0435\u0430\u0433\u0438\u0440\u0443\u0435\u0442 \u043d\u0430 \u043a\u043e\u043d\u0442\u0435\u043a\u0441 \u0438 \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u0442 \u043d\u043e\u0432\u044b\u0439 \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442.<\/p>\n<p>  \u0412 \u0434\u0430\u043d\u043d\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u043c\u044b \u043f\u0435\u0440\u0435\u0434\u0430\u0435\u043c \u0434\u0432\u0430 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u0430 \u0432 <code>children<\/code>: \u0432\u0438\u0434 \u0434\u0438\u0432\u0430\u0439\u0441\u0430 \u0438 \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u043b\u0438 \u0443\u0441\u0442\u0440\u043e\u0439\u0441\u0442\u0432\u043e \u0441\u0435\u043d\u0441\u043e\u0440\u043d\u044b\u043c.<\/p>\n<pre><code class=\"javascript\">import React from \"react\"; import PropTypes from \"prop-types\"; import { defaultTo } from \"lodash\";  import { devices, defaultDevice } from \"..\/constanst\"; import { Consumer } from '..\/context';  function MediaConsumer(props) {   return (     &lt;Consumer&gt;       {media =&gt; props.children({         touchable: defaultTo(media.touchable, props.defaultTouchable),         device: defaultTo(media.device, props.defaultDevice),       })}     &lt;\/Consumer&gt;   ) }  MediaConsumer.propTypes = {   defaultTouchable: PropTypes.bool,   defaultDevice: PropTypes.oneOf(devices),   children: PropTypes.func.isRequired };  MediaConsumer.defaultProps = {   defaultDevice,   defaultTouchable: false };  export { MediaConsumer }; <\/code><\/pre>\n<p>  \u0422\u0435\u043f\u0435\u0440\u044c \u0432 \u043d\u0430\u0448\u0435\u043c \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0438 \u0434\u043e\u0441\u0442\u0443\u043f\u0435\u043d \u043d\u043e\u0432\u044b\u0439 \u043a\u043e\u043d\u0442\u0435\u043a\u0441\u0442, \u0434\u0430\u0432\u0430\u0439\u0442\u0435 \u0438\u043c \u0432\u043e\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c\u0441\u044f.<\/p>\n<pre><code class=\"javascript\">import React from \"react\"; import ReactDOM from \"react-dom\"; import { isMobile } from \"react-device-detect\"; import cx from \"classnames\"; import { ThemeConsumer, ThemeProvider } from \".\/theme-context\"; import { MediaConsumer, MediaProvider } from \".\/media-context\";  import \".\/styles.css\";  function renderSVG({ device, touchable }) {   if (device === \"mobile\" &amp;&amp; touchable) {     return \"https:\/\/image.flaticon.com\/icons\/svg\/124\/124114.svg\";   }    if (device === \"tablet\" &amp;&amp; touchable) {     return \"https:\/\/image.flaticon.com\/icons\/svg\/124\/124099.svg\";   }    if (device === \"desktop\") {     return \"https:\/\/image.flaticon.com\/icons\/svg\/124\/124092.svg\";   } }  function MyComponent() {   const renderMyComponent = (theme, media) =&gt; {     const myComponentClassName = cx(\"my-class\", {       \"my-class-dark\": theme === \"dark\",       \"my-class-light\": theme === \"light\"     });     return (       &lt;div className=\"wrapperDiv\"&gt;         &lt;object           className={myComponentClassName}           data={renderSVG(media)}           type=\"image\/svg+xml\"         \/&gt;       &lt;\/div&gt;     );   };   return (     &lt;MediaConsumer&gt;       {media =&gt; (         &lt;ThemeConsumer&gt;           {theme =&gt; renderMyComponent(theme, media)}         &lt;\/ThemeConsumer&gt;       )}     &lt;\/MediaConsumer&gt;   ); }  function App() {   return (     &lt;MediaProvider       device={isMobile ? \"mobile\" : \"desktop\"}       touchable={isMobile}     &gt;       &lt;ThemeProvider theme=\"light\"&gt;         &lt;MyComponent \/&gt;       &lt;\/ThemeProvider&gt;     &lt;\/MediaProvider&gt;   ); }  const rootElement = document.getElementById(\"root\"); ReactDOM.render(&lt;App \/&gt;, rootElement); <\/code><\/pre>\n<p>  \u0414\u043b\u044f \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f \u043c\u0435\u0434\u0438\u0430\u043a\u043e\u043d\u0442\u0435\u0441\u0442\u0430 \u043d\u0430\u043c \u043f\u043e\u0442\u0440\u0435\u0431\u0443\u0435\u0442\u0441\u044f \u043c\u0435\u0434\u0438\u0430\u0434\u0435\u0442\u0435\u043a\u0442\u043e\u0440 (\u0434\u043b\u044f \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u0438\u044f \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u0438 \u043e \u0434\u0438\u0432\u0430\u0439\u0441\u0435 \u044e\u0437\u0435\u0440\u0430). \u0412 \u043d\u0430\u0448\u0435\u043c \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0438 \u043c\u0435\u0434\u0438\u0430\u0434\u0435\u0442\u0435\u043a\u0442\u043e\u0440\u0430 \u043d\u0435\u0442, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u0432\u043e\u0437\u044c\u043c\u0435\u043c \u0435\u0433\u043e \u043e\u0442\u0441\u044e\u0434\u0430 \u2014 <a href=\"https:\/\/www.npmjs.com\/package\/react-device-detect\">react-device-detect<\/a>, \u0430 \u0438\u043c\u0435\u043d\u043d\u043e \u0444\u043b\u0430\u0433 <u>isMobile<\/u>.<\/p>\n<p>  \u041a\u0430\u043a \u0438 \u0441 \u043a\u043e\u043d\u0442\u0435\u043a\u0441\u0442\u043d\u043e\u0439 \u0442\u0435\u043c\u043e\u0439, \u043c\u044b \u043e\u0431\u0435\u0440\u043d\u0435\u043c \u043d\u0430\u0448 \u0442\u0435\u0441\u0442\u043e\u0432\u044b\u0439 \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442 \u0432 \u043c\u0435\u0434\u0438\u0430\u043f\u0440\u043e\u0432\u0430\u0439\u0434\u0435\u0440\u0435. \u0417\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u043f\u0440\u043e\u043f\u0441\u043e\u0432, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043f\u0440\u043e\u0432\u0430\u0439\u0434\u0435\u0440 \u043f\u0435\u0440\u0435\u0434\u0430\u0441\u0442 \u0441\u0432\u043e\u0435\u043c\u0443 \u043a\u043e\u043d\u0441\u044e\u043c\u0435\u0440\u0443, \u0431\u0443\u0434\u0443\u0442 \u0437\u0430\u0432\u0438\u0441\u0442\u044c \u043e\u0442 \u0443\u0441\u0442\u0440\u043e\u0439\u0441\u0442\u0432\u0430 \u043a\u043b\u0438\u0435\u043d\u0442\u0430. \u0417\u0430\u0448\u0435\u043b \u0441 \u043c\u043e\u0431\u0438\u043b\u044c\u043d\u043e\u0433\u043e, \u043f\u043e\u0441\u044b\u043b\u0430\u0435\u043c \u043c\u043e\u0431\u0438\u043b\u044c\u043d\u0443\u044e \u0432\u0435\u0440\u0441\u0438\u044e \u0441\u0430\u0439\u0442\u0430, \u0441 \u043a\u043e\u043c\u043f\u044c\u044e\u0442\u0435\u0440\u0430 \u2014 \u0434\u0435\u0441\u043a\u0442\u043e\u043f\u043d\u0443\u044e. <a href=\"https:\/\/codesandbox.io\/s\/blazing-paper-nwfst\">\u0420\u0430\u0431\u043e\u0447\u0438\u0439 \u043a\u043e\u0434 \u043c\u043e\u0436\u043d\u043e \u043f\u043e\u0441\u043c\u043e\u0442\u0440\u0435\u0442\u044c \u0442\u0443\u0442<\/a>.<\/p>\n<p>  \u0427\u0442\u043e\u0431\u044b \u0443\u0432\u0438\u0434\u0435\u0442\u044c \u0440\u0430\u0437\u043d\u0438\u0446\u0443, \u0437\u0430\u0439\u0434\u0438\u0442\u0435 \u043f\u043e \u0441\u0441\u044b\u043b\u043a\u0435 \u0441 \u043d\u0430\u0441\u0442\u043e\u043b\u044c\u043d\u043e\u0433\u043e \u0438 \u043c\u043e\u0431\u0438\u043b\u044c\u043d\u043e\u0433\u043e \u0431\u0440\u0430\u0443\u0437\u0435\u0440\u0430.<\/p>\n<p>  \u0412\u0441\u0435! \u0422\u0435\u043f\u0435\u0440\u044c \u043d\u0430\u0448\u0435 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u0438\u043c\u0435\u0435\u0442 \u0434\u0432\u0430 \u043a\u043e\u043d\u0442\u0435\u043a\u0441\u0442\u0430, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043f\u043e\u043c\u043e\u0433\u0443\u0442 \u043d\u0430\u043c \u0441\u043e\u0437\u0434\u0430\u0432\u0430\u0442\u044c \u0431\u043e\u043b\u0435\u0435 \u0440\u0430\u0437\u043d\u043e\u0441\u0442\u043e\u0440\u043e\u043d\u043d\u0438\u0435 \u0438 \u0433\u0438\u0431\u043a\u0438\u0435 \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u044b \u0432 \u043d\u0430\u0448\u0435\u043c UI-Kit. \u0412 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u043c \u043f\u043e\u0441\u0442\u0443 \u044f \u043f\u043e\u043f\u0440\u043e\u0431\u0443\u044e \u0441\u043e\u0437\u0434\u0430\u0442\u044c \u043a\u043e\u043c\u043f\u043b\u0435\u043a\u0441\u043d\u044b\u0439 \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442 \u0441 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435\u043c \u043e\u0431\u043e\u0438\u0445 \u043a\u043e\u043d\u0442\u0435\u043a\u0441\u0442\u043e\u0432. \u041d\u0430\u0434\u0435\u044e\u0441\u044c, \u0412\u044b \u043d\u0430\u0439\u0434\u0435\u0442\u0435 \u0441\u0442\u0430\u0442\u044c\u044e \u043f\u043e\u043b\u0435\u0437\u043d\u043e\u0439.<\/p>\n<p>  \u0421\u043f\u0430\u0441\u0438\u0431\u043e.<\/p><\/div>\n<p>               <script class=\"js-mediator-script\">!function(e){function t(t,n){if(!(n in e)){for(var r,a=e.document,i=a.scripts,o=i.length;o--;)if(-1!==i[o].src.indexOf(t)){r=i[o];break}if(!r){r=a.createElement(\"script\"),r.type=\"text\/javascript\",r.async=!0,r.defer=!0,r.src=t,r.charset=\"UTF-8\";var d=function(){var e=a.getElementsByTagName(\"script\")[0];e.parentNode.insertBefore(r,e)};\"[object Opera]\"==e.opera?a.addEventListener?a.addEventListener(\"DOMContentLoaded\",d,!1):e.attachEvent(\"onload\",d):d()}}}t(\"\/\/mediator.mail.ru\/script\/2820404\/\",\"_mediator\")}(window);<\/script>     <br \/> \u0441\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b \u0441\u0442\u0430\u0442\u044c\u0438 <a href=\"https:\/\/habr.com\/ru\/post\/463597\/\"> https:\/\/habr.com\/ru\/post\/463597\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"\n<div class=\"post__text post__text-html js-mediator-article\">\u041f\u0440\u0438\u0432\u0435\u0442, \u0434\u0430\u043d\u043d\u0430\u044f \u0441\u0442\u0430\u0442\u044c\u044f \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u043f\u0440\u043e\u0434\u043e\u043b\u0436\u0435\u043d\u0438\u0435\u043c <a href=\"https:\/\/habr.com\/ru\/post\/462963\/\">\u0432\u043e\u0442 \u044d\u0442\u043e\u0433\u043e \u043f\u043e\u0441\u0442\u0430<\/a>, \u0433\u0434\u0435 \u044f \u0440\u0435\u0448\u0438\u043b \u043d\u0430\u0447\u0430\u0442\u044c \u0441\u0435\u0440\u0438\u044e \u043d\u0435\u0431\u043e\u043b\u044c\u0448\u0438\u0445 \u0443\u0447\u0435\u0431\u043d\u044b\u0445 \u043f\u043e\u0441\u043e\u0431\u0438\u0439 \u043f\u043e \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044e UI-Kit. \u0422\u0430\u043c \u043e\u043f\u0438\u0441\u0430\u043d \u043c\u0435\u0442\u043e\u0434 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f \u043a\u043e\u043d\u0442\u0435\u043a\u0441\u0442\u0430 \u0434\u043b\u044f \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f \u0442\u0435\u043c\u044b \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f. \u0421\u0435\u0433\u043e\u0434\u043d\u044f \u044f \u0445\u043e\u0447\u0443 \u0434\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u044c \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u0435\u0449\u0435 \u043e\u0434\u043d\u0438\u043c \u043a\u043e\u043d\u0442\u0435\u043a\u0441\u0442\u043e\u043c, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043f\u043e\u043c\u043e\u0436\u0435\u0442 \u043d\u0430\u043c \u043f\u043e\u043a\u0430\u0437\u044b\u0432\u0430\u0442\u044c \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u044b UI, \u043e\u0441\u043d\u043e\u0432\u044b\u0432\u0430\u044f\u0441\u044c \u043d\u0430 \u0434\u0438\u0432\u0430\u0439\u0441\u0435 \u044e\u0437\u0435\u0440\u0430.<\/p>\n<p>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/post_images\/a07\/487\/f45\/a07487f45ea98d589cc8af25e7d011af.jpg\" alt=\"image\">  <\/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-293344","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/293344","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=293344"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/293344\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=293344"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=293344"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=293344"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}