{"id":443808,"date":"2025-01-02T15:01:49","date_gmt":"2025-01-02T15:01:49","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=443808"},"modified":"-0001-11-30T00:00:00","modified_gmt":"2025-01-02T15:01:49","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=443808","title":{"rendered":"<span>\u041e\u043f\u0442\u0438\u043c\u0438\u0437\u0430\u0446\u0438\u044f React-\u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0439: \u0418\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c useTransition, useDeferredValue \u0438 useOptimistic \u0434\u043b\u044f \u043f\u043b\u0430\u0432\u043d\u043e\u0433\u043e UI<\/span>"},"content":{"rendered":"<div><!--[--><!--]--><\/div>\n<div id=\"post-content-body\">\n<div>\n<div class=\"article-formatted-body article-formatted-body article-formatted-body_version-2\">\n<div xmlns=\"http:\/\/www.w3.org\/1999\/xhtml\">\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w780q1\/getpro\/habr\/upload_files\/bb8\/606\/dd9\/bb8606dd9f85f4c65d46ab5cee4e8b05.jpg\" alt=\" \u0418\u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u0435, \u0441\u043e\u0437\u0434\u0430\u043d\u043d\u043e\u0435 DALL-E  \" title=\" \u0418\u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u0435, \u0441\u043e\u0437\u0434\u0430\u043d\u043d\u043e\u0435 DALL-E  \" width=\"1792\" height=\"1024\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/bb8\/606\/dd9\/bb8606dd9f85f4c65d46ab5cee4e8b05.jpg\" data-blurred=\"true\"\/><\/p>\n<div><figcaption> \u0418\u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u0435, \u0441\u043e\u0437\u0434\u0430\u043d\u043d\u043e\u0435 DALL-E  <\/figcaption><\/div>\n<\/figure>\n<p>\u0412\u0435\u0431-\u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u0441\u0435\u0433\u043e\u0434\u043d\u044f \u0442\u0440\u0435\u0431\u0443\u044e\u0442 \u0432\u0441\u0451 \u0431\u043e\u043b\u044c\u0448\u0435\u0439 \u0438\u043d\u0442\u0435\u0440\u0430\u043a\u0442\u0438\u0432\u043d\u043e\u0441\u0442\u0438, \u043e\u0442\u0437\u044b\u0432\u0447\u0438\u0432\u043e\u0441\u0442\u0438 \u0438 \u0431\u044b\u0441\u0442\u0440\u043e\u0434\u0435\u0439\u0441\u0442\u0432\u0438\u044f. \u0412 \u043e\u0442\u0432\u0435\u0442 \u043d\u0430 \u044d\u0442\u043e \u043a\u043e\u043c\u0430\u043d\u0434\u0430 React \u043f\u043e\u0441\u0442\u043e\u044f\u043d\u043d\u043e \u0441\u043e\u0432\u0435\u0440\u0448\u0435\u043d\u0441\u0442\u0432\u0443\u0435\u0442 \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442\u0430\u0440\u0438\u0439, \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u044e\u0449\u0438\u0439 \u043d\u0430\u043c \u0442\u043e\u043d\u043a\u043e \u0443\u043f\u0440\u0430\u0432\u043b\u044f\u0442\u044c \u0440\u0435\u043d\u0434\u0435\u0440\u0438\u043d\u0433\u043e\u043c \u0438 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u0441\u043a\u0438\u043c \u043e\u043f\u044b\u0442\u043e\u043c. \u0415\u0441\u043b\u0438 \u0432\u044b \u0440\u0430\u0431\u043e\u0442\u0430\u043b\u0438 \u0442\u043e\u043b\u044c\u043a\u043e \u0441 \u043a\u043b\u0430\u0441\u0441\u0438\u0447\u0435\u0441\u043a\u0438\u043c\u0438 \u043c\u0435\u0442\u043e\u0434\u0430\u043c\u0438 \u043e\u043f\u0442\u0438\u043c\u0438\u0437\u0430\u0446\u0438\u0438 \u0432\u0440\u043e\u0434\u0435 <code>useMemo<\/code>, <code>useCallback<\/code>, \u043c\u0435\u043c\u043e\u0438\u0437\u0430\u0446\u0438\u0438 \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442 \u0447\u0435\u0440\u0435\u0437 <code>React.memo<\/code> \u0438 \u0434\u0440\u0443\u0433\u0438\u043c\u0438 \u0438\u0437\u0432\u0435\u0441\u0442\u043d\u044b\u043c\u0438 \u043f\u0440\u0438\u0451\u043c\u0430\u043c\u0438, \u0442\u043e \u0432\u0430\u0441 \u043c\u043e\u0433\u0443\u0442 \u0437\u0430\u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043e\u0432\u0430\u0442\u044c \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0435 \u0445\u0443\u043a\u0438:<\/p>\n<ol>\n<li>\n<p><code>useTransition<\/code> &#8212; \u0443\u0441\u0442\u0430\u043d\u0430\u0432\u043b\u0438\u0432\u0430\u0435\u0442 \u043f\u0440\u0438\u043e\u0440\u0438\u0442\u0435\u0442\u044b \u0440\u0435\u043d\u0434\u0435\u0440\u0438\u043d\u0433\u0430, \u0440\u0430\u0437\u0434\u0435\u043b\u044f\u044f \u043e\u0431\u043d\u043e\u0432\u043b\u0435\u043d\u0438\u044f \u043d\u0430 \u043a\u0440\u0438\u0442\u0438\u0447\u0435\u0441\u043a\u0438\u0435 \u0438 \u0444\u043e\u043d\u043e\u0432\u044b\u0435.<\/p>\n<\/li>\n<li>\n<p><code>useDeferredValue<\/code> &#8212; \u043e\u0442\u043a\u043b\u0430\u0434\u044b\u0432\u0430\u0435\u0442 \u043e\u0431\u043d\u043e\u0432\u043b\u0435\u043d\u0438\u0435 \u0442\u044f\u0436\u0451\u043b\u044b\u0445 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0439, \u0447\u0442\u043e\u0431\u044b \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441 \u043d\u0435 \u0444\u0440\u0438\u0437\u0438\u043b\u0441\u044f \u043f\u0440\u0438 \u0432\u0432\u043e\u0434\u0435 \u0434\u0430\u043d\u043d\u044b\u0445.<\/p>\n<\/li>\n<li>\n<p><code>useOptimistic<\/code> &#8212; \u043f\u043e\u043c\u043e\u0433\u0430\u0435\u0442 \u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u0442\u044c \u043e\u043f\u0442\u0438\u043c\u0438\u0441\u0442\u0438\u0447\u043d\u044b\u0435 \u043e\u0431\u043d\u043e\u0432\u043b\u0435\u043d\u0438\u044f &#171;\u0438\u0437 \u043a\u043e\u0440\u043e\u0431\u043a\u0438&#187;.<\/p>\n<\/li>\n<\/ol>\n<p>\u0412 \u044d\u0442\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0435 \u043c\u044b \u0440\u0430\u0437\u0431\u0435\u0440\u0451\u043c \u043a\u043b\u044e\u0447\u0435\u0432\u044b\u0435 \u0438\u0434\u0435\u0438 \u043a\u0430\u0436\u0434\u043e\u0433\u043e \u0438\u0437 \u044d\u0442\u0438\u0445 \u0445\u0443\u043a\u043e\u0432 \u0438 \u0440\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u043f\u0440\u0430\u043a\u0442\u0438\u0447\u0435\u0441\u043a\u0438\u0435 \u043f\u0440\u0438\u043c\u0435\u0440\u044b, \u0447\u0442\u043e\u0431\u044b \u0441\u0442\u0430\u043b\u043e \u044f\u0441\u043d\u043e, \u043a\u0430\u043a \u0438 \u043a\u043e\u0433\u0434\u0430 \u0438\u0445 \u043f\u0440\u0438\u043c\u0435\u043d\u044f\u0442\u044c.<\/p>\n<h3>useTransition: \u043f\u0440\u0438\u043e\u0440\u0438\u0442\u0435\u0442\u044b \u0440\u0435\u043d\u0434\u0435\u0440\u0438\u043d\u0433\u0430 \u0438 \u043f\u043b\u0430\u0432\u043d\u043e\u0441\u0442\u044c UI<\/h3>\n<h3>\u041e\u0431\u0449\u0430\u044f \u0438\u0434\u0435\u044f<\/h3>\n<p>\u041a\u043e\u0433\u0434\u0430 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c \u0441\u043e\u0432\u0435\u0440\u0448\u0430\u0435\u0442 \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0435 (\u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u0432\u0432\u043e\u0434\u0438\u0442 \u0442\u0435\u043a\u0441\u0442, \u043f\u0435\u0440\u0435\u043a\u043b\u044e\u0447\u0430\u0435\u0442 \u0432\u043a\u043b\u0430\u0434\u043a\u0438, \u0436\u043c\u0451\u0442 \u043a\u043d\u043e\u043f\u043a\u0443), \u043d\u0430\u043c \u043c\u043e\u0436\u0435\u0442 \u043f\u043e\u043d\u0430\u0434\u043e\u0431\u0438\u0442\u044c\u0441\u044f \u0432\u044b\u043f\u043e\u043b\u043d\u0438\u0442\u044c \u0434\u043e\u0432\u043e\u043b\u044c\u043d\u043e \u0442\u044f\u0436\u0435\u043b\u043e\u0435 \u043e\u0431\u043d\u043e\u0432\u043b\u0435\u043d\u0438\u0435 \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u044f: \u0444\u0438\u043b\u044c\u0442\u0440\u0430\u0446\u0438\u044f \u0431\u043e\u043b\u044c\u0448\u043e\u0439 \u043a\u043e\u043b\u043b\u0435\u043a\u0446\u0438\u0438, \u043f\u0435\u0440\u0435\u0441\u0447\u0451\u0442 \u0441\u043b\u043e\u0436\u043d\u044b\u0445 \u0434\u0430\u043d\u043d\u044b\u0445, \u043f\u0435\u0440\u0435\u0441\u0442\u0440\u043e\u0439\u043a\u0430 \u0442\u0430\u0431\u043b\u0438\u0446\u044b \u0438 \u0442.\u0434. \u0415\u0441\u043b\u0438 \u0432\u0441\u0451 \u044d\u0442\u043e \u043f\u0440\u043e\u0438\u0437\u043e\u0439\u0434\u0451\u0442 \u0441\u0440\u0430\u0437\u0443 (\u0441 \u0432\u044b\u0441\u043e\u043a\u0438\u043c \u043f\u0440\u0438\u043e\u0440\u0438\u0442\u0435\u0442\u043e\u043c), \u0442\u043e UI \u043c\u043e\u0436\u0435\u0442 \u043f\u043e\u0434\u0432\u0438\u0441\u043d\u0443\u0442\u044c \u043d\u0430 \u0441\u0435\u043a\u0443\u043d\u0434\u0443 &#8212; \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c \u0443\u0432\u0438\u0434\u0438\u0442 \u0437\u0430\u0434\u0435\u0440\u0436\u043a\u0443 \u043f\u0440\u0438 \u043d\u0430\u0436\u0430\u0442\u0438\u0438 \u0438\u043b\u0438 \u0432\u0432\u043e\u0434\u0435 \u0442\u0435\u043a\u0441\u0442\u0430.<\/p>\n<p>\u0412 React 18 \u043f\u043e\u044f\u0432\u0438\u043b\u0441\u044f \u0445\u0443\u043a <code>useTransition<\/code>, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u043f\u043e\u043c\u0435\u0442\u0438\u0442\u044c \u043a\u0430\u043a\u043e\u0435-\u0442\u043e \u043e\u0431\u043d\u043e\u0432\u043b\u0435\u043d\u0438\u0435 \u043a\u0430\u043a &#171;\u043d\u0435\u043a\u0440\u0438\u0442\u0438\u0447\u043d\u043e\u0435&#187; \u0438\u043b\u0438 &#171;\u043f\u0435\u0440\u0435\u0445\u043e\u0434\u043d\u043e\u0435&#187;. \u041f\u0440\u0438 \u044d\u0442\u043e\u043c \u043a\u043b\u044e\u0447\u0435\u0432\u044b\u0435 \u043c\u043e\u043c\u0435\u043d\u0442\u044b \u0432\u0437\u0430\u0438\u043c\u043e\u0434\u0435\u0439\u0441\u0442\u0432\u0438\u044f \u0441 \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441\u043e\u043c (\u043a\u043b\u0438\u043a, \u0432\u0432\u043e\u0434) \u043e\u0441\u0442\u0430\u044e\u0442\u0441\u044f \u043e\u0442\u0437\u044b\u0432\u0447\u0438\u0432\u044b\u043c\u0438, \u0430 \u0441\u0430\u043c\u043e \u0442\u044f\u0436\u0451\u043b\u043e\u0435 \u043e\u0431\u043d\u043e\u0432\u043b\u0435\u043d\u0438\u0435 \u043c\u043e\u0436\u0435\u0442 \u043f\u0440\u043e\u0438\u0441\u0445\u043e\u0434\u0438\u0442\u044c \u0447\u0443\u0442\u044c \u043f\u043e\u0437\u0436\u0435 \u0438\u043b\u0438 \u0432 \u0444\u043e\u043d\u043e\u0432\u043e\u043c \u0440\u0435\u0436\u0438\u043c\u0435.<\/p>\n<h4>\u041a\u0430\u043a \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c\u0441\u044f: \u0431\u0430\u0437\u043e\u0432\u044b\u0439 \u043f\u0440\u0438\u043c\u0435\u0440<\/h4>\n<p>\u0412 \u044d\u0442\u043e\u043c \u043f\u0440\u0438\u043c\u0435\u0440\u0435, \u043f\u0440\u0438 \u0432\u0432\u043e\u0434\u0435 \u0442\u0435\u043a\u0441\u0442\u0430, \u043f\u043e\u043b\u0435 \u0432\u0432\u043e\u0434\u0430 \u043e\u0431\u043d\u043e\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u043c\u0433\u043d\u043e\u0432\u0435\u043d\u043d\u043e, \u0447\u0442\u043e\u0431\u044b \u0431\u044b\u0442\u044c \u043e\u0442\u0437\u044b\u0432\u0447\u0438\u0432\u044b\u043c, \u043d\u043e \u0444\u0438\u043b\u044c\u0442\u0440\u0430\u0446\u0438\u044f \u0431\u043e\u043b\u044c\u0448\u043e\u0433\u043e \u0441\u043f\u0438\u0441\u043a\u0430 (filteredItems) \u043e\u0431\u043e\u0440\u0430\u0447\u0438\u0432\u0430\u0435\u0442\u0441\u044f \u0432 <code>startTransition<\/code>, \u0447\u0442\u043e \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 React &#171;\u043f\u0440\u0438\u043e\u0441\u0442\u0430\u043d\u0430\u0432\u043b\u0438\u0432\u0430\u0442\u044c&#187; \u0432\u044b\u0447\u0438\u0441\u043b\u0435\u043d\u0438\u044f, \u0435\u0441\u043b\u0438 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c \u0432\u0432\u043e\u0434\u0438\u0442 \u043c\u043d\u043e\u0433\u043e \u0441\u0438\u043c\u0432\u043e\u043b\u043e\u0432 \u043f\u043e\u0434\u0440\u044f\u0434. \u042d\u0442\u043e \u043f\u043e\u043c\u043e\u0433\u0430\u0435\u0442 \u0438\u0437\u0431\u0435\u0436\u0430\u0442\u044c \u0437\u0430\u0434\u0435\u0440\u0436\u0435\u043a \u0432 \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441\u0435. \u0418\u043d\u0434\u0438\u043a\u0430\u0442\u043e\u0440 \u0437\u0430\u0433\u0440\u0443\u0437\u043a\u0438 \u043e\u0442\u043e\u0431\u0440\u0430\u0436\u0430\u0435\u0442\u0441\u044f, \u043f\u043e\u043a\u0430 \u043f\u0440\u043e\u0446\u0435\u0441\u0441 \u0444\u0438\u043b\u044c\u0442\u0440\u0430\u0446\u0438\u0438 \u043d\u0435 \u0437\u0430\u0432\u0435\u0440\u0448\u0438\u0442\u0441\u044f.  <\/p>\n<pre><code class=\"javascript\">import React, { useState, useTransition } from 'react';  function BigList({ items }) {   return (     &lt;ul&gt;       {items.map((item) =&gt; (         &lt;li key={item.id}&gt;{item.text}&lt;\/li&gt;       ))}     &lt;\/ul&gt;   ); }  export default function App() {   const [text, setText] = useState('');   const [filteredItems, setFilteredItems] = useState([]);   const [isPending, startTransition] = useTransition(); \/\/ \u0425\u0443\u043a useTransition    \/\/ \u0414\u043e\u043f\u0443\u0441\u0442\u0438\u043c, \u0443 \u043d\u0430\u0441 \u0435\u0441\u0442\u044c \u0431\u043e\u043b\u044c\u0448\u0430\u044f \u043a\u043e\u043b\u043b\u0435\u043a\u0446\u0438\u044f   const allItems = Array.from({ length: 10000 }, (_, i) =&gt; ({     id: i,     text: `Item ${i}`   }));    const handleInputChange = (e) =&gt; {     const value = e.target.value;     setText(value);      \/\/ \u041d\u0435\u043a\u0440\u0438\u0442\u0438\u0447\u043d\u043e\u0435 \u043e\u0431\u043d\u043e\u0432\u043b\u0435\u043d\u0438\u0435 \u0432\u044b\u043d\u0435\u0441\u0435\u043c \u0432 startTransition     startTransition(() =&gt; {       const filtered = allItems.filter((item) =&gt;         item.text.toLowerCase().includes(value.toLowerCase())       );       setFilteredItems(filtered);     });   };    return (     &lt;div&gt;       &lt;h1&gt;\u0421\u043f\u0438\u0441\u043e\u043a: {filteredItems.length} \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u043e\u0432&lt;\/h1&gt;       &lt;input         value={text}         onChange={handleInputChange}         placeholder=\"\u041f\u043e\u0438\u0441\u043a \u043f\u043e \u0441\u043f\u0438\u0441\u043a\u0443...\"       \/&gt;       {\/* \u041f\u043e\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u043c \u0438\u043d\u0434\u0438\u043a\u0430\u0442\u043e\u0440, \u0435\u0441\u043b\u0438 useTransition \u0435\u0449\u0451 \"\u0432 \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u0435\" *\/}       {isPending &amp;&amp; &lt;p&gt;Loading...&lt;\/p&gt;}        &lt;BigList items={filteredItems} \/&gt;     &lt;\/div&gt;   ); }<\/code><\/pre>\n<h4>\u041a\u0430\u043a \u044d\u0442\u043e \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442?<\/h4>\n<ul>\n<li>\n<p>\u041f\u0440\u0438 \u043a\u0430\u0436\u0434\u043e\u043c \u0432\u0432\u043e\u0434\u0435 \u0441\u0438\u043c\u0432\u043e\u043b\u0430 \u043c\u044b \u0441\u0440\u0430\u0437\u0443 \u043e\u0431\u043d\u043e\u0432\u043b\u044f\u0435\u043c <code>text<\/code> (\u0447\u0442\u043e\u0431\u044b \u043f\u043e\u043b\u0435 \u0432\u0432\u043e\u0434\u0430 \u0431\u044b\u043b\u043e \u043e\u0442\u0437\u044b\u0432\u0447\u0438\u0432\u044b\u043c).<\/p>\n<\/li>\n<li>\n<p>\u041d\u043e \u043f\u0435\u0440\u0435\u0441\u0447\u0451\u0442 \u0431\u043e\u043b\u044c\u0448\u043e\u0433\u043e \u0441\u043f\u0438\u0441\u043a\u0430 (<code>filteredItems<\/code>) \u043e\u0431\u043e\u0440\u0430\u0447\u0438\u0432\u0430\u0435\u043c \u0432 <code>startTransition(...)<\/code>.<\/p>\n<\/li>\n<li>\n<p>\u0415\u0441\u043b\u0438 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c \u0432\u0432\u043e\u0434\u0438\u0442 \u043c\u043d\u043e\u0433\u043e \u0441\u0438\u043c\u0432\u043e\u043b\u043e\u0432 \u043f\u043e\u0434\u0440\u044f\u0434 \u0431\u044b\u0441\u0442\u0440\u043e, React \u043c\u043e\u0436\u0435\u0442 \u043f\u0440\u0438\u043e\u0441\u0442\u0430\u043d\u0430\u0432\u043b\u0438\u0432\u0430\u0442\u044c \u0432\u044b\u0447\u0438\u0441\u043b\u0435\u043d\u0438\u044f \u0438 \u043e\u0431\u043d\u043e\u0432\u043b\u044f\u0442\u044c \u0441\u043f\u0438\u0441\u043e\u043a, \u0442\u043e\u043b\u044c\u043a\u043e \u043a\u043e\u0433\u0434\u0430 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c \u043f\u0440\u0438\u0442\u043e\u0440\u043c\u043e\u0437\u0438\u0442 \u0441 \u0432\u0432\u043e\u0434\u043e\u043c &#8212; \u0447\u0442\u043e\u0431\u044b UI \u043e\u0441\u0442\u0430\u0432\u0430\u043b\u0441\u044f \u043f\u043b\u0430\u0432\u043d\u044b\u043c.<\/p>\n<\/li>\n<li>\n<p><code>isPending<\/code> \u0433\u043e\u0432\u043e\u0440\u0438\u0442, \u0447\u0442\u043e &#171;\u043f\u0435\u0440\u0435\u0445\u043e\u0434&#187; \u0435\u0449\u0451 \u0438\u0434\u0451\u0442, \u0438 \u043c\u043e\u0436\u043d\u043e \u043f\u043e\u043a\u0430\u0437\u044b\u0432\u0430\u0442\u044c \u0438\u043d\u0434\u0438\u043a\u0430\u0442\u043e\u0440 \u0437\u0430\u0433\u0440\u0443\u0437\u043a\u0438.<\/p>\n<\/li>\n<\/ul>\n<h4>\u041a\u0430\u043a\u0438\u0435 \u0437\u0430\u0434\u0430\u0447\u0438 \u0440\u0435\u0448\u0430\u0435\u0442 useTransition?<\/h4>\n<ul>\n<li>\n<p><strong>\u0424\u0438\u043b\u044c\u0442\u0440\u0430\u0446\u0438\u044f\/\u0441\u043e\u0440\u0442\u0438\u0440\u043e\u0432\u043a\u0430<\/strong> \u0431\u043e\u043b\u044c\u0448\u0438\u0445 \u0441\u043f\u0438\u0441\u043a\u043e\u0432.<\/p>\n<\/li>\n<li>\n<p><strong>\u041f\u0435\u0440\u0435\u0440\u0438\u0441\u043e\u0432\u043a\u0430<\/strong> \u0441\u043b\u043e\u0436\u043d\u044b\u0445 \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442 (\u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u043a\u0430\u0440\u0442 \u0441 \u043c\u043d\u043e\u0436\u0435\u0441\u0442\u0432\u043e\u043c \u043e\u0431\u044a\u0435\u043a\u0442\u043e\u0432).<\/p>\n<\/li>\n<li>\n<p><strong>\u041f\u043b\u0430\u0432\u043d\u044b\u0435 \u0430\u043d\u0438\u043c\u0430\u0446\u0438\u0438<\/strong> \u043f\u0440\u0438 \u043f\u0435\u0440\u0435\u0445\u043e\u0434\u0435 \u043c\u0435\u0436\u0434\u0443 \u044d\u043a\u0440\u0430\u043d\u0430\u043c\u0438 \u0438\u043b\u0438 \u0432\u043a\u043b\u0430\u0434\u043a\u0430\u043c\u0438.<\/p>\n<\/li>\n<\/ul>\n<h4>\u041f\u043e\u0434\u0432\u043e\u0434\u043d\u044b\u0435 \u043a\u0430\u043c\u043d\u0438 \u0438 \u0437\u0430\u043c\u0435\u0447\u0430\u043d\u0438\u044f<\/h4>\n<ul>\n<li>\n<p><code>useTransition<\/code> \u043d\u0435 \u043e\u0442\u043c\u0435\u043d\u044f\u0435\u0442 \u0441\u0430\u043c\u043e \u0432\u044b\u0447\u0438\u0441\u043b\u0435\u043d\u0438\u0435; \u043e\u043d\u043e \u043f\u0440\u043e\u0441\u0442\u043e \u0434\u0430\u0451\u0442 React \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044c \u043e\u043f\u0442\u0438\u043c\u0430\u043b\u044c\u043d\u0435\u0435 \u0440\u0430\u0441\u043f\u0440\u0435\u0434\u0435\u043b\u044f\u0442\u044c \u043f\u0440\u0438\u043e\u0440\u0438\u0442\u0435\u0442\u044b.<\/p>\n<\/li>\n<li>\n<p>\u0415\u0441\u043b\u0438 \u0443 \u0432\u0430\u0441 \u043e\u0447\u0435\u043d\u044c \u0442\u044f\u0436\u0451\u043b\u0430\u044f \u043b\u043e\u0433\u0438\u043a\u0430, \u043c\u043e\u0436\u0435\u0442 \u043f\u043e\u0442\u0440\u0435\u0431\u043e\u0432\u0430\u0442\u044c\u0441\u044f \u0434\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u0430\u044f \u043e\u043f\u0442\u0438\u043c\u0438\u0437\u0430\u0446\u0438\u044f (\u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u043c\u0435\u043c\u043e\u0438\u0437\u0430\u0446\u0438\u044f \u0438\u043b\u0438 \u0432\u044b\u043d\u0435\u0441\u0435\u043d\u0438\u0435 \u0432\u044b\u0447\u0438\u0441\u043b\u0435\u043d\u0438\u0439 \u043d\u0430 Web Worker).<\/p>\n<\/li>\n<li>\n<p>\u041d\u0435 \u0437\u043b\u043e\u0443\u043f\u043e\u0442\u0440\u0435\u0431\u043b\u044f\u0439\u0442\u0435 <code>useTransition<\/code>: \u0435\u0441\u043b\u0438 \u0432\u0441\u0435 \u043e\u0431\u043d\u043e\u0432\u043b\u0435\u043d\u0438\u044f \u043f\u043e\u043c\u0435\u0447\u0430\u0442\u044c \u043a\u0430\u043a &#171;\u043d\u0435\u043a\u0440\u0438\u0442\u0438\u0447\u043d\u044b\u0435&#187;, \u0442\u043e \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u0438 \u0431\u0443\u0434\u0443\u0442 \u0432\u0438\u0434\u0435\u0442\u044c \u0437\u0430\u0434\u0435\u0440\u0436\u043a\u0438.<\/p>\n<\/li>\n<\/ul>\n<h3>useDeferredValue: \u043b\u0435\u043d\u0438\u0432\u043e\u0435 \u043e\u0431\u043d\u043e\u0432\u043b\u0435\u043d\u0438\u0435 \u0431\u043e\u043b\u044c\u0448\u0438\u0445 \u0434\u0430\u043d\u043d\u044b\u0445<\/h3>\n<h4>\u0412 \u0447\u0451\u043c \u0441\u0443\u0442\u044c?<\/h4>\n<p><code>useDeferredValue<\/code> &#8212; \u0435\u0449\u0451 \u043e\u0434\u0438\u043d \u0445\u0443\u043a, \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u043d\u044b\u0439 \u0432 React 18, \u0440\u0435\u0448\u0430\u0435\u0442 \u043f\u043e\u0445\u043e\u0436\u0443\u044e \u0437\u0430\u0434\u0430\u0447\u0443 \u043e\u043f\u0442\u0438\u043c\u0438\u0437\u0430\u0446\u0438\u0438. \u041d\u043e \u0437\u0434\u0435\u0441\u044c \u043c\u044b \u0438\u043c\u0435\u0435\u043c \u0434\u0435\u043b\u043e \u043d\u0435 \u0441 \u0440\u0430\u0437\u043c\u0435\u0442\u043a\u043e\u0439 \u043e\u0431\u043d\u043e\u0432\u043b\u0435\u043d\u0438\u044f (\u043a\u0430\u043a \u0432 <code>useTransition<\/code>), \u0430 \u0441 &#171;\u0434\u0432\u043e\u0439\u043d\u044b\u043c&#187; \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u0435\u043c:<\/p>\n<ul>\n<li>\n<p><strong>\u041e\u0441\u043d\u043e\u0432\u043d\u043e\u0435 \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u0435<\/strong>, \u043a\u043e\u0442\u043e\u0440\u043e\u0435 \u043e\u0431\u043d\u043e\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0441\u0440\u0430\u0437\u0443.<\/p>\n<\/li>\n<li>\n<p><strong>\u041e\u0442\u043b\u043e\u0436\u0435\u043d\u043d\u043e\u0435 \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u0435<\/strong>, \u043a\u043e\u0442\u043e\u0440\u043e\u0435 \u043c\u043e\u0436\u0435\u0442 \u043e\u0431\u043d\u043e\u0432\u043b\u044f\u0442\u044c\u0441\u044f \u0447\u0443\u0442\u044c \u043f\u043e\u0437\u0436\u0435, \u0441 \u043c\u0435\u043d\u044c\u0448\u0438\u043c \u043f\u0440\u0438\u043e\u0440\u0438\u0442\u0435\u0442\u043e\u043c.<\/p>\n<\/li>\n<\/ul>\n<p>\u042d\u0442\u043e \u0431\u044b\u0432\u0430\u0435\u0442 \u043f\u043e\u043b\u0435\u0437\u043d\u043e, \u043a\u043e\u0433\u0434\u0430 \u0443 \u043d\u0430\u0441, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u0432 \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441\u0435 \u0435\u0441\u0442\u044c \u043f\u043e\u043b\u0435 \u0432\u0432\u043e\u0434\u0430 \u0438 \u043e\u0433\u0440\u043e\u043c\u043d\u044b\u0439 \u0441\u043f\u0438\u0441\u043e\u043a\/\u0442\u0430\u0431\u043b\u0438\u0446\u0430, \u0437\u0430\u0432\u0438\u0441\u044f\u0449\u0430\u044f \u043e\u0442 \u044d\u0442\u043e\u0433\u043e \u0432\u0432\u043e\u0434\u0430. \u041c\u044b \u0445\u043e\u0442\u0438\u043c, \u0447\u0442\u043e\u0431\u044b \u0438\u043d\u043f\u0443\u0442 \u043d\u0435 \u0442\u043e\u0440\u043c\u043e\u0437\u0438\u043b, \u0430 \u043e\u0431\u043d\u043e\u0432\u043b\u0435\u043d\u0438\u0435 \u0441\u043f\u0438\u0441\u043a\u0430 \u043f\u0440\u043e\u0438\u0441\u0445\u043e\u0434\u0438\u043b\u043e \u043b\u0435\u043d\u0438\u0432\u043e (deferred).<\/p>\n<h4>\u041f\u0440\u0438\u043c\u0435\u0440 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f<\/h4>\n<p>\u0417\u0434\u0435\u0441\u044c \u043f\u0440\u0438 \u0432\u0432\u043e\u0434\u0435 \u0442\u0435\u043a\u0441\u0442\u0430 \u043f\u043e\u043b\u0435 \u043e\u0431\u043d\u043e\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0441\u0440\u0430\u0437\u0443, \u043d\u043e \u0434\u043b\u044f \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u0430 <code>SearchResults<\/code> \u043f\u0435\u0440\u0435\u0434\u0430\u0435\u0442\u0441\u044f \u043e\u0442\u043b\u043e\u0436\u0435\u043d\u043d\u043e\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e <code>useDeferredValue<\/code>. \u042d\u0442\u043e \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 React \u043e\u0431\u043d\u043e\u0432\u043b\u044f\u0442\u044c \u0441\u043f\u0438\u0441\u043e\u043a \u0441 \u043c\u0435\u043d\u044c\u0448\u0438\u043c \u043f\u0440\u0438\u043e\u0440\u0438\u0442\u0435\u0442\u043e\u043c, \u043f\u0440\u0435\u0434\u043e\u0442\u0432\u0440\u0430\u0449\u0430\u044f \u043b\u0438\u0448\u043d\u0438\u0435 \u0440\u0435\u043d\u0434\u0435\u0440\u044b \u043f\u0440\u0438 \u043a\u0430\u0436\u0434\u043e\u043c \u0432\u0432\u043e\u0434\u0435 \u0438 \u0443\u043b\u0443\u0447\u0448\u0430\u044f \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u044c, \u043e\u0441\u043e\u0431\u0435\u043d\u043d\u043e \u043f\u0440\u0438 \u0440\u0430\u0431\u043e\u0442\u0435 \u0441 \u0431\u043e\u043b\u044c\u0448\u0438\u043c\u0438 \u0434\u0430\u043d\u043d\u044b\u043c\u0438.  <\/p>\n<pre><code class=\"javascript\">import React, { useState, useDeferredValue, memo } from 'react';  const SearchResults = memo(function SearchResults({ searchTerm }) {   \/\/ \u0414\u043e\u043f\u0443\u0441\u0442\u0438\u043c, searchTerm - \u044d\u0442\u043e \u0443\u0436\u0435 \u043e\u0442\u043b\u043e\u0436\u0435\u043d\u043d\u043e\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435   const allItems = Array.from({ length: 5000 }, (_, i) =&gt; `Item ${i}`);    \/\/ \u041c\u043e\u0434\u0435\u043b\u0438\u0440\u0443\u0435\u043c \u043a\u0430\u043a\u0443\u044e-\u0442\u043e \u0442\u044f\u0436\u0451\u043b\u0443\u044e \u0444\u0438\u043b\u044c\u0442\u0440\u0430\u0446\u0438\u044e   const filteredItems = allItems.filter((item) =&gt;     item.toLowerCase().includes(searchTerm.toLowerCase())   );    return (     &lt;ul&gt;       {filteredItems.map((item, idx) =&gt; (         &lt;li key={idx}&gt;{item}&lt;\/li&gt;       ))}     &lt;\/ul&gt;   ); });  export default function App() {   const [inputValue, setInputValue] = useState('');   \/\/ \"\u041e\u0442\u043b\u043e\u0436\u0435\u043d\u043d\u043e\u0435\" \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u043d\u0430 \u043e\u0441\u043d\u043e\u0432\u0435 \u0442\u0435\u043a\u0443\u0449\u0435\u0433\u043e inputValue   const deferredValue = useDeferredValue(inputValue);    const handleChange = (e) =&gt; {     setInputValue(e.target.value);   };    return (     &lt;div&gt;       &lt;input value={inputValue} onChange={handleChange} placeholder=\"\u041f\u043e\u0438\u0441\u043a...\" \/&gt;       {\/*          \u0412 \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442 SearchResults \u043f\u0435\u0440\u0435\u0434\u0430\u0435\u043c \u041d\u0415 inputValue \u043d\u0430\u043f\u0440\u044f\u043c\u0443\u044e,         \u0430 \u0438\u043c\u0435\u043d\u043d\u043e deferredValue, \u0447\u0442\u043e\u0431\u044b \u043e\u043d \u043c\u043e\u0433 \u043e\u0431\u043d\u043e\u0432\u0438\u0442\u044c\u0441\u044f \u0441 \u043c\u0435\u043d\u044c\u0448\u0438\u043c \u043f\u0440\u0438\u043e\u0440\u0438\u0442\u0435\u0442\u043e\u043c        *\/}       &lt;SearchResults searchTerm={deferredValue} \/&gt;     &lt;\/div&gt;   ); }<\/code><\/pre>\n<h4>\u041a\u0430\u043a \u044d\u0442\u043e \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442?<\/h4>\n<ul>\n<li>\n<p><code>inputValue<\/code> \u043c\u0435\u043d\u044f\u0435\u0442\u0441\u044f \u043c\u0433\u043d\u043e\u0432\u0435\u043d\u043d\u043e, \u0438 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c \u0441\u0440\u0430\u0437\u0443 \u0432\u0438\u0434\u0438\u0442, \u0447\u0442\u043e \u043f\u043e\u043b\u0435 \u0432\u0432\u043e\u0434\u0430 \u043e\u0442\u0440\u0430\u0436\u0430\u0435\u0442 \u0435\u0433\u043e \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u044f (\u0431\u0435\u0437 \u0437\u0430\u0434\u0435\u0440\u0436\u043a\u0438).<\/p>\n<\/li>\n<li>\n<p>\u041d\u043e <code>SearchResults<\/code> \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u0442 \u043d\u0435 <code>inputValue<\/code>, \u0430 <code>deferredValue<\/code>. \u042d\u0442\u043e \u0437\u043d\u0430\u0447\u0438\u0442, \u0447\u0442\u043e React \u043c\u043e\u0436\u0435\u0442 \u043f\u043e\u0434\u043e\u0436\u0434\u0430\u0442\u044c \u043f\u043e\u0434\u0445\u043e\u0434\u044f\u0449\u0438\u0439 \u043c\u043e\u043c\u0435\u043d\u0442 \u0434\u043b\u044f \u0440\u0435\u043d\u0434\u0435\u0440\u0430.<\/p>\n<\/li>\n<li>\n<p>\u0422\u0430\u043a \u043c\u044b \u0438\u0437\u0431\u0435\u0433\u0430\u0435\u043c \u043c\u043e\u043c\u0435\u043d\u0442\u0430\u043b\u044c\u043d\u044b\u0445 \u0440\u0435\u0440\u0435\u043d\u0434\u0435\u0440\u043e\u0432 \u0442\u044f\u0436\u0451\u043b\u044b\u0445 \u0441\u043f\u0438\u0441\u043a\u043e\u0432 \u043f\u0440\u0438 \u043a\u0430\u0436\u0434\u043e\u043c \u043d\u0430\u0431\u0440\u0430\u043d\u043d\u043e\u043c \u0441\u0438\u043c\u0432\u043e\u043b\u0435.<\/p>\n<\/li>\n<\/ul>\n<h4>\u041e\u0442\u043b\u0438\u0447\u0438\u0435 \u043e\u0442 useTransition<\/h4>\n<ul>\n<li>\n<p><code>useTransition<\/code>: \u043c\u044b \u044f\u0432\u043d\u043e \u043e\u0431\u043e\u0440\u0430\u0447\u0438\u0432\u0430\u0435\u043c \u043a\u0430\u043a\u0443\u044e-\u0442\u043e \u043b\u043e\u0433\u0438\u043a\u0443 (\u043e\u0431\u043d\u043e\u0432\u043b\u0435\u043d\u0438\u0435 \u0441\u0442\u0435\u0439\u0442\u0430) \u0432 <code>startTransition<\/code>.<\/p>\n<\/li>\n<li>\n<p><code>useDeferredValue<\/code>: \u043c\u044b \u0438\u043c\u0435\u0435\u043c \u0434\u0432\u0430 \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u044f &#8212; \u043e\u0441\u043d\u043e\u0432\u043d\u043e\u0435 \u0438 \u043e\u0442\u043b\u043e\u0436\u0435\u043d\u043d\u043e\u0435. \u041f\u0440\u043e\u0441\u0442\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c <code>deferredValue<\/code> \u0442\u0430\u043c, \u0433\u0434\u0435 \u0440\u0435\u043d\u0434\u0435\u0440\u044b \u043c\u043e\u0433\u0443\u0442 \u0431\u044b\u0442\u044c \u043e\u0442\u043b\u043e\u0436\u0435\u043d\u044b.<\/p>\n<\/li>\n<\/ul>\n<p>\u0418\u043d\u043e\u0433\u0434\u0430 \u044d\u0442\u0438 \u0445\u0443\u043a\u0438 \u043c\u043e\u0436\u043d\u043e \u043a\u043e\u043c\u0431\u0438\u043d\u0438\u0440\u043e\u0432\u0430\u0442\u044c &#8212; \u0432\u0441\u0451 \u0437\u0430\u0432\u0438\u0441\u0438\u0442 \u043e\u0442 \u043a\u043e\u043d\u043a\u0440\u0435\u0442\u043d\u043e\u0439 \u0437\u0430\u0434\u0430\u0447\u0438.<\/p>\n<h4>\u0417\u0430\u0447\u0435\u043c \u043d\u0443\u0436\u0435\u043d useDeferredValue, \u0435\u0441\u043b\u0438 \u0435\u0441\u0442\u044c useDebounce?<\/h4>\n<p>\u041e\u0431\u0430 \u0445\u0443\u043a\u0430 \u0440\u0435\u0448\u0430\u044e\u0442 \u0437\u0430\u0434\u0430\u0447\u0438, \u0441\u0432\u044f\u0437\u0430\u043d\u043d\u044b\u0435 \u0441 \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u044c\u044e, \u043d\u043e \u0434\u0435\u043b\u0430\u044e\u0442 \u044d\u0442\u043e \u0440\u0430\u0437\u043d\u044b\u043c\u0438 \u0441\u043f\u043e\u0441\u043e\u0431\u0430\u043c\u0438. <a href=\"https:\/\/www.npmjs.com\/package\/use-debounce\" rel=\"noopener noreferrer nofollow\">useDebounce<\/a> \u043f\u043e\u043b\u0435\u0437\u0435\u043d \u0434\u043b\u044f \u0437\u0430\u0434\u0435\u0440\u0436\u043a\u0438 \u0432\u044b\u0437\u043e\u0432\u043e\u0432 \u0444\u0443\u043d\u043a\u0446\u0438\u0439 \u043d\u0430 \u043e\u0441\u043d\u043e\u0432\u0435 \u0432\u0440\u0435\u043c\u0435\u043d\u0438, \u0447\u0442\u043e\u0431\u044b \u043f\u0440\u0435\u0434\u043e\u0442\u0432\u0440\u0430\u0442\u0438\u0442\u044c \u0447\u0430\u0441\u0442\u044b\u0435 \u043e\u0431\u043d\u043e\u0432\u043b\u0435\u043d\u0438\u044f \u0434\u0430\u043d\u043d\u044b\u0445, \u0442\u043e\u0433\u0434\u0430 \u043a\u0430\u043a <code>useDeferredValue<\/code> \u043f\u0440\u0435\u0434\u043d\u0430\u0437\u043d\u0430\u0447\u0435\u043d \u0434\u043b\u044f \u0443\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u044f \u043f\u0440\u0438\u043e\u0440\u0438\u0442\u0435\u0442\u043e\u043c \u043e\u0431\u043d\u043e\u0432\u043b\u0435\u043d\u0438\u0439 \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441\u0430. \u0415\u0441\u043b\u0438 \u0437\u0430\u0434\u0430\u0447\u0430 \u0437\u0430\u043a\u043b\u044e\u0447\u0430\u0435\u0442\u0441\u044f \u0432 \u0442\u043e\u043c, \u0447\u0442\u043e\u0431\u044b \u043d\u0435 \u0431\u043b\u043e\u043a\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441 \u043f\u0440\u0438 \u0440\u0435\u043d\u0434\u0435\u0440\u0438\u043d\u0433\u0435 \u0431\u043e\u043b\u044c\u0448\u043e\u0433\u043e \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u0430 \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u043e\u0432, \u043d\u043e \u043f\u0440\u0438 \u044d\u0442\u043e\u043c \u043d\u0435 \u0437\u0430\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u0442\u044c \u043e\u0431\u043d\u043e\u0432\u043b\u0435\u043d\u0438\u0435 \u0441\u0430\u043c\u043e\u0433\u043e \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f (\u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u0432 \u043f\u043e\u043b\u0435 \u0432\u0432\u043e\u0434\u0430), \u0442\u043e <code>useDeferredValue<\/code> &#8212; \u043b\u0443\u0447\u0448\u0438\u0439 \u0432\u044b\u0431\u043e\u0440.<\/p>\n<p>\u0412 \u0442\u043e \u0432\u0440\u0435\u043c\u044f \u043a\u0430\u043a <code>useDebounce<\/code> \u043c\u043e\u0436\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0434\u043b\u044f \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0438 \u0430\u0441\u0438\u043d\u0445\u0440\u043e\u043d\u043d\u044b\u0445 \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u0439 (\u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u0434\u043b\u044f \u0443\u043c\u0435\u043d\u044c\u0448\u0435\u043d\u0438\u044f \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u0430 \u0437\u0430\u043f\u0440\u043e\u0441\u043e\u0432), <code>useDeferredValue<\/code> \u043b\u0443\u0447\u0448\u0435 \u043f\u043e\u0434\u0445\u043e\u0434\u0438\u0442 \u0434\u043b\u044f \u0443\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u044f \u0440\u0435\u043d\u0434\u0435\u0440\u043e\u043c \u0438 \u0430\u0441\u0438\u043d\u0445\u0440\u043e\u043d\u043d\u044b\u043c\u0438 \u043e\u0431\u043d\u043e\u0432\u043b\u0435\u043d\u0438\u044f\u043c\u0438 \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.<\/p>\n<h3>useOptimistic: \u043e\u043f\u0442\u0438\u043c\u0438\u0441\u0442\u0438\u0447\u043d\u044b\u0435 \u043e\u0431\u043d\u043e\u0432\u043b\u0435\u043d\u0438\u044f \u0431\u0435\u0437 \u0431\u043e\u043b\u0438 <\/h3>\n<h4>\u0427\u0442\u043e \u0442\u0430\u043a\u043e\u0435 \u043e\u043f\u0442\u0438\u043c\u0438\u0441\u0442\u0438\u0447\u043d\u044b\u0435 \u043e\u0431\u043d\u043e\u0432\u043b\u0435\u043d\u0438\u044f?<\/h4>\n<p>\u0414\u043e\u043f\u0443\u0441\u0442\u0438\u043c, \u0443 \u043d\u0430\u0441 \u0435\u0441\u0442\u044c \u0444\u043e\u0440\u043c\u0430, \u0433\u0434\u0435 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c \u043c\u043e\u0436\u0435\u0442 \u043e\u0442\u043f\u0440\u0430\u0432\u0438\u0442\u044c \u043a\u043e\u043c\u043c\u0435\u043d\u0442\u0430\u0440\u0438\u0439 \u0438\u043b\u0438 \u043f\u043e\u0441\u0442. \u0412 \u043a\u043b\u0430\u0441\u0441\u0438\u0447\u0435\u0441\u043a\u043e\u043c \u0441\u0446\u0435\u043d\u0430\u0440\u0438\u0438 \u043c\u044b:<\/p>\n<ol>\n<li>\n<p>\u041e\u0442\u043f\u0440\u0430\u0432\u043b\u044f\u0435\u043c \u0437\u0430\u043f\u0440\u043e\u0441 \u043d\u0430 \u0441\u0435\u0440\u0432\u0435\u0440.<\/p>\n<\/li>\n<li>\n<p>\u0416\u0434\u0451\u043c \u043e\u0442\u0432\u0435\u0442\u0430 (200 OK).<\/p>\n<\/li>\n<li>\n<p>\u0422\u043e\u043b\u044c\u043a\u043e \u0442\u043e\u0433\u0434\u0430 \u043e\u0431\u043d\u043e\u0432\u043b\u044f\u0435\u043c UI, \u043f\u043e\u043a\u0430\u0437\u044b\u0432\u0430\u044f \u043d\u043e\u0432\u044b\u0439 \u043a\u043e\u043c\u043c\u0435\u043d\u0442\u0430\u0440\u0438\u0439 \u0432 \u0441\u043f\u0438\u0441\u043a\u0435.<\/p>\n<\/li>\n<\/ol>\n<p>\u041d\u043e \u0435\u0441\u043b\u0438 \u0437\u0430\u0434\u0435\u0440\u0436\u043a\u0430 \u0431\u043e\u043b\u044c\u0448\u0430\u044f, \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c \u0432\u0438\u0434\u0438\u0442 \u0437\u0430\u0432\u0438\u0441\u0430\u043d\u0438\u0435: \u0444\u043e\u0440\u043c\u0430 \u043d\u0435 \u043e\u0431\u043d\u043e\u0432\u043b\u044f\u0435\u0442\u0441\u044f, \u0445\u043e\u0442\u044f \u043e\u043d \u0443\u0436\u0435 \u043d\u0430\u0436\u0430\u043b \u041e\u0442\u043f\u0440\u0430\u0432\u0438\u0442\u044c. \u0427\u0442\u043e\u0431\u044b \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441 \u043a\u0430\u0437\u0430\u043b\u0441\u044f \u0448\u0443\u0441\u0442\u0440\u0435\u0435, \u043c\u044b \u0434\u0435\u043b\u0430\u0435\u043c \u043e\u043f\u0442\u0438\u043c\u0438\u0441\u0442\u0438\u0447\u043d\u043e\u0435 \u043e\u0431\u043d\u043e\u0432\u043b\u0435\u043d\u0438\u0435 &#8212; \u0441\u0440\u0430\u0437\u0443 \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u043c \u043a\u043e\u043c\u043c\u0435\u043d\u0442\u0430\u0440\u0438\u0439 \u0432 \u0441\u043f\u0438\u0441\u043e\u043a \u043a\u0430\u043a \u0431\u0443\u0434\u0442\u043e \u0437\u0430\u043f\u0440\u043e\u0441 \u0441\u0440\u0430\u0431\u043e\u0442\u0430\u043b, \u0430 \u0435\u0441\u043b\u0438 \u0447\u0442\u043e-\u0442\u043e \u043f\u043e\u0448\u043b\u043e \u043d\u0435 \u0442\u0430\u043a (\u0441\u0435\u0440\u0432\u0435\u0440 \u0432\u0435\u0440\u043d\u0443\u043b \u043e\u0448\u0438\u0431\u043a\u0443), \u0442\u043e \u043e\u0442\u043a\u0430\u0442\u044b\u0432\u0430\u0435\u043c.<\/p>\n<p>\u0420\u0430\u043d\u0435\u0435 \u044d\u0442\u043e \u043f\u0440\u0438\u0445\u043e\u0434\u0438\u043b\u043e\u0441\u044c \u0432\u0440\u0443\u0447\u043d\u0443\u044e \u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u044b\u0432\u0430\u0442\u044c: \u0445\u0440\u0430\u043d\u0438\u0442\u044c \u0432\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0435 \u0430\u0439\u0434\u0438\u0448\u043d\u0438\u043a\u0438, \u043e\u0442\u043c\u0435\u043d\u044f\u0442\u044c \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u044f \u0432 \u0441\u043b\u0443\u0447\u0430\u0435 \u043e\u0448\u0438\u0431\u043a\u0438 \u0438 \u0442. \u0434. \u041d\u043e \u0432 <strong>React 19<\/strong> \u0435\u0441\u0442\u044c \u0445\u0443\u043a <code>useOptimistic<\/code>, \u043f\u0440\u0438\u0437\u0432\u0430\u043d\u043d\u044b\u0439 \u0443\u043f\u0440\u043e\u0441\u0442\u0438\u0442\u044c \u0432\u0441\u044e \u044d\u0442\u0443 \u0441\u0445\u0435\u043c\u0443.<\/p>\n<h4>\u041a\u0430\u043a \u044d\u0442\u043e \u0432\u044b\u0433\u043b\u044f\u0434\u0438\u0442 \u0432 \u043a\u043e\u0434\u0435?<\/h4>\n<p>\u0412 \u044d\u0442\u043e\u043c \u043f\u0440\u0438\u043c\u0435\u0440\u0435 \u043f\u0440\u0438 \u043e\u0442\u043f\u0440\u0430\u0432\u043a\u0435 \u043d\u043e\u0432\u043e\u0433\u043e \u043a\u043e\u043c\u043c\u0435\u043d\u0442\u0430\u0440\u0438\u044f \u043e\u043d \u0441\u0440\u0430\u0437\u0443 \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0432 \u0441\u043f\u0438\u0441\u043e\u043a, \u0441\u043e\u0437\u0434\u0430\u0432\u0430\u044f \u0432\u0438\u0434\u0438\u043c\u043e\u0441\u0442\u044c \u0443\u0441\u043f\u0435\u0448\u043d\u043e\u0439 \u043e\u0442\u043f\u0440\u0430\u0432\u043a\u0438. \u0415\u0441\u043b\u0438 \u0437\u0430\u043f\u0440\u043e\u0441 \u043d\u0430 \u0441\u0435\u0440\u0432\u0435\u0440 \u043d\u0435 \u0443\u0434\u0430\u0451\u0442\u0441\u044f, \u0432\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0439 \u043a\u043e\u043c\u043c\u0435\u043d\u0442\u0430\u0440\u0438\u0439 \u0443\u0434\u0430\u043b\u044f\u0435\u0442\u0441\u044f, \u0438 \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441 \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u0442\u0441\u044f \u043a \u0438\u0441\u0445\u043e\u0434\u043d\u043e\u043c\u0443 \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u044e. \u042d\u0442\u043e \u0434\u0435\u043b\u0430\u0435\u0442 \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441 \u0431\u043e\u043b\u0435\u0435 \u043e\u0442\u0437\u044b\u0432\u0447\u0438\u0432\u044b\u043c, \u043f\u043e\u0441\u043a\u043e\u043b\u044c\u043a\u0443 \u043d\u0435 \u043d\u0443\u0436\u043d\u043e \u0436\u0434\u0430\u0442\u044c \u043e\u0442\u0432\u0435\u0442\u0430 \u043e\u0442 \u0441\u0435\u0440\u0432\u0435\u0440\u0430 \u0434\u043b\u044f \u043e\u0431\u043d\u043e\u0432\u043b\u0435\u043d\u0438\u044f UI.<\/p>\n<pre><code class=\"javascript\">import { useOptimistic, useState, useRef } from \"react\";  async function makeOrder(orderName) {   \/\/ \u043c\u043e\u043a \u0437\u0430\u043f\u0440\u043e\u0441\u0430 \u043d\u0430 \u0441\u0435\u0440\u0432\u0435\u0440   await new Promise((res) =&gt; setTimeout(res, 1500));   return orderName; }  function Kitchen({ orders, onMakeOrder }) {   const formRef = useRef();    async function formAction(formData) {     const orderName = formData.get(\"orderName\");     addOptimisticOrder(orderName);     formRef.current.reset();     await onMakeOrder(orderName);   }    const [optimisticOrders, addOptimisticOrder] = useOptimistic(     orders,     (state, newOrder) =&gt; [...state, { orderName: newOrder, preparing: true }]   );    return (     &lt;div&gt;       &lt;form action={formAction} ref={formRef}&gt;         &lt;input type=\"text\" name=\"orderName\" placeholder=\"\u0412\u0432\u0435\u0434\u0438\u0442\u0435 \u0437\u0430\u043a\u0430\u0437!\" \/&gt;         &lt;button type=\"submit\"&gt;\u0417\u0430\u043a\u0430\u0437\u0430\u0442\u044c&lt;\/button&gt;       &lt;\/form&gt;        {optimisticOrders.map((order, index) =&gt; (         &lt;div key={index}&gt;           {order.orderName}           {order.preparing ? (             &lt;span&gt; (\u0413\u043e\u0442\u043e\u0432\u0438\u0442\u044c\u0441\u044f...)&lt;\/span&gt;           ) : (             &lt;span&gt; (\u0413\u043e\u0442\u043e\u0432!)&lt;\/span&gt;           )}         &lt;\/div&gt;       ))}     &lt;\/div&gt;   ); }  export default function App() {   const [orders, setOrders] = useState([]);    async function onMakeOrder(orderName) {     const sentOrder = await makeOrder(orderName);     setOrders((orders) =&gt; [...orders, { orderName: sentOrder }]);   }    return &lt;Kitchen orders={orders} onMakeOrder={onMakeOrder} \/&gt;; } <\/code><\/pre>\n<h4>\u0427\u0435\u043c \u044d\u0442\u043e \u0443\u0434\u043e\u0431\u043d\u043e?<\/h4>\n<ul>\n<li>\n<p><code>useOptimistic<\/code> \u0443\u043f\u0440\u043e\u0449\u0430\u0435\u0442 \u0445\u0440\u0430\u043d\u0435\u043d\u0438\u0435 \u0440\u0435\u0430\u043b\u044c\u043d\u043e\u0433\u043e \u0438 \u043e\u043f\u0442\u0438\u043c\u0438\u0441\u0442\u0438\u0447\u043d\u043e\u0433\u043e \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u044f.<\/p>\n<\/li>\n<li>\n<p>\u041d\u0430\u043c \u043d\u0435 \u043d\u0443\u0436\u043d\u043e \u0432\u0440\u0443\u0447\u043d\u0443\u044e \u0434\u0435\u043b\u0430\u0442\u044c \u043c\u043d\u043e\u0433\u043e\u0443\u0440\u043e\u0432\u043d\u0435\u0432\u044b\u0439 \u043c\u0438\u043a\u0441 \u0441\u0442\u0435\u0439\u0442\u0430: \u0445\u0443\u043a \u0438\u0437 \u043a\u043e\u0440\u043e\u0431\u043a\u0438 \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u0442 \u0441\u0440\u0435\u0434\u0441\u0442\u0432\u0430 \u0434\u043b\u044f \u043e\u0442\u043a\u0430\u0442\u0430 \u0438 \u043e\u0431\u044a\u0435\u0434\u0438\u043d\u0435\u043d\u0438\u044f \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u0439.<\/p>\n<\/li>\n<li>\n<p>\u041f\u0440\u0438 \u043e\u0448\u0438\u0431\u043a\u0435 \u0437\u0430\u043f\u0440\u043e\u0441\u0430 \u043c\u044b \u043c\u043e\u0436\u0435\u043c \u043f\u0440\u043e\u0441\u0442\u043e \u043e\u0442\u043a\u0430\u0442\u0438\u0442\u044c \u043e\u043f\u0442\u0438\u043c\u0438\u0441\u0442\u0438\u0447\u043d\u043e\u0435 \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0435.<\/p>\n<\/li>\n<\/ul>\n<h3>\u0420\u0435\u0430\u043b\u044c\u043d\u044b\u0435 \u043a\u0435\u0439\u0441\u044b, \u0433\u0434\u0435 \u044d\u0442\u0438 \u0445\u0443\u043a\u0438 \u0443\u043f\u0440\u043e\u0449\u0430\u044e\u0442 \u0436\u0438\u0437\u043d\u044c<\/h3>\n<ul>\n<li>\n<p><strong>\u041f\u043e\u0438\u0441\u043a \u0438 \u0430\u0432\u0442\u043e\u0434\u043e\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u0435<\/strong>:<\/p>\n<ul>\n<li>\n<p><code>useDeferredValue<\/code> \u043f\u043e\u043c\u043e\u0433\u0430\u0435\u0442 \u0438\u0437\u0431\u0435\u0436\u0430\u0442\u044c \u043f\u043e\u0434\u0432\u0438\u0441\u0430\u043d\u0438\u0439 \u043f\u0440\u0438 \u043a\u0430\u0436\u0434\u043e\u043c \u0432\u0432\u0435\u0434\u0451\u043d\u043d\u043e\u043c \u0441\u0438\u043c\u0432\u043e\u043b\u0435.<\/p>\n<\/li>\n<li>\n<p><code>useTransition<\/code> &#8212; \u0435\u0441\u043b\u0438 \u043d\u0443\u0436\u043d\u043e \u043e\u0434\u043d\u043e\u0432\u0440\u0435\u043c\u0435\u043d\u043d\u043e \u043f\u043e\u043a\u0430\u0437\u044b\u0432\u0430\u0442\u044c \u0436\u0438\u0432\u043e\u0435 \u0430\u0432\u0442\u043e\u0434\u043e\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u0435 \u0438 \u043f\u0440\u0438 \u044d\u0442\u043e\u043c \u043f\u0435\u0440\u0435\u0440\u0438\u0441\u043e\u0432\u044b\u0432\u0430\u0442\u044c \u0441\u043b\u043e\u0436\u043d\u044b\u0435 \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u044b.<\/p>\n<\/li>\n<\/ul>\n<\/li>\n<li>\n<p><strong>\u041e\u043d\u043b\u0430\u0439\u043d-\u0440\u0435\u0434\u0430\u043a\u0442\u043e\u0440\u044b<\/strong> (\u0442\u0435\u043a\u0441\u0442, \u0433\u0440\u0430\u0444\u0438\u043a\u0430 \u0438 \u043f\u0440.):<\/p>\n<ul>\n<li>\n<p>\u041f\u0440\u0438 \u043c\u0430\u0441\u0448\u0442\u0430\u0431\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0438 \u043f\u043e\u043b\u043e\u0442\u043d\u0430 \u0438\u043b\u0438 \u043f\u0440\u0438 \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u044f\u0445 \u0432 \u0431\u043e\u043b\u044c\u0448\u043e\u043c \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0435, \u043c\u044b \u043c\u043e\u0436\u0435\u043c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u043f\u0435\u0440\u0435\u0445\u043e\u0434\u044b, \u0447\u0442\u043e\u0431\u044b UI \u043e\u0441\u0442\u0430\u0432\u0430\u043b\u0441\u044f \u043e\u0442\u0437\u044b\u0432\u0447\u0438\u0432\u044b\u043c.<\/p>\n<\/li>\n<\/ul>\n<\/li>\n<li>\n<p><strong>\u041c\u0435\u0441\u0441\u0435\u043d\u0434\u0436\u0435\u0440\u044b \u0438 \u0441\u043e\u0446\u0438\u0430\u043b\u044c\u043d\u044b\u0435 \u0441\u0435\u0442\u0438<\/strong>:<\/p>\n<ul>\n<li>\n<p><code>useOptimistic<\/code> \u0438\u0434\u0435\u0430\u043b\u044c\u043d\u043e \u043f\u043e\u0434\u0445\u043e\u0434\u0438\u0442 \u0434\u043b\u044f \u043e\u0442\u043f\u0440\u0430\u0432\u043a\u0438 \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u0439, \u043a\u043e\u043c\u043c\u0435\u043d\u0442\u0430\u0440\u0438\u0435\u0432, \u043b\u0430\u0439\u043a\u043e\u0432 &#8212; \u0447\u0442\u043e\u0431\u044b \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c \u0432\u0438\u0434\u0435\u043b \u0431\u044b\u0441\u0442\u0440\u044b\u0439 \u043e\u0442\u043a\u043b\u0438\u043a (\u0421\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u0435 \u043e\u0442\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u043e), \u0430 \u043f\u0440\u0438 \u043e\u0448\u0438\u0431\u043a\u0435 \u043c\u044b \u043c\u043e\u0433\u043b\u0438 \u043e\u0442\u043a\u0430\u0442\u0438\u0442\u044c \u0438 \u043f\u043e\u043a\u0430\u0437\u0430\u0442\u044c \u0443\u0432\u0435\u0434\u043e\u043c\u043b\u0435\u043d\u0438\u0435.<\/p>\n<\/li>\n<\/ul>\n<\/li>\n<li>\n<p><strong>\u042d\u043b\u0435\u043a\u0442\u0440\u043e\u043d\u043d\u0430\u044f \u043a\u043e\u043c\u043c\u0435\u0440\u0446\u0438\u044f<\/strong> (\u043a\u043e\u0440\u0437\u0438\u043d\u044b, \u0437\u0430\u043a\u0430\u0437\u044b):<\/p>\n<ul>\n<li>\n<p>\u041e\u043f\u0442\u0438\u043c\u0438\u0441\u0442\u0438\u0447\u043d\u043e\u0435 \u0434\u043e\u0431\u0430\u0432\u043b\u0435\u043d\u0438\u0435 \u0442\u043e\u0432\u0430\u0440\u043e\u0432 \u0432 \u043a\u043e\u0440\u0437\u0438\u043d\u0443 \u0438\u043b\u0438 \u043e\u0444\u043e\u0440\u043c\u043b\u0435\u043d\u0438\u0435 \u0437\u0430\u043a\u0430\u0437\u0430 \u0441 \u043c\u0433\u043d\u043e\u0432\u0435\u043d\u043d\u043e\u0439 \u0440\u0435\u0430\u043a\u0446\u0438\u0435\u0439 UI.<\/p>\n<\/li>\n<\/ul>\n<\/li>\n<li>\n<p><strong>\u0424\u0438\u043b\u044c\u0442\u0440\u0430\u0446\u0438\u044f \u0438 \u0441\u043e\u0440\u0442\u0438\u0440\u043e\u0432\u043a\u0430<\/strong> \u0431\u043e\u043b\u044c\u0448\u0438\u0445 \u0442\u0430\u0431\u043b\u0438\u0446, \u0441\u043f\u0438\u0441\u043a\u043e\u0432:<\/p>\n<ul>\n<li>\n<p><code>useDeferredValue<\/code> \u0438 <code>useTransition<\/code> \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u044e\u0442 \u043d\u0435 \u0431\u043b\u043e\u043a\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441 \u043f\u0440\u0438 \u043a\u0430\u0436\u0434\u043e\u043c \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u0438 \u0444\u0438\u043b\u044c\u0442\u0440\u0430.<\/p>\n<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<h3>\u041a\u043e\u0433\u0434\u0430 (\u0438 \u043a\u0430\u043a) \u043d\u0435 \u0441\u0442\u043e\u0438\u0442 \u043f\u0440\u0438\u043c\u0435\u043d\u044f\u0442\u044c \u044d\u0442\u0438 \u0445\u0443\u043a\u0438<\/h3>\n<ul>\n<li>\n<p>\u0422\u0430\u043c, \u0433\u0434\u0435 \u043d\u0435\u0442 \u0431\u043e\u043b\u044c\u0448\u0438\u0445 \u0434\u0430\u043d\u043d\u044b\u0445. \u0415\u0441\u043b\u0438 \u0441\u043f\u0438\u0441\u043e\u043a \u043c\u0430\u043b\u0435\u043d\u044c\u043a\u0438\u0439 (\u0434\u0432\u0430\u0434\u0446\u0430\u0442\u044c \u0437\u0430\u043f\u0438\u0441\u0435\u0439) \u0438 \u0432\u0441\u0451 \u0438 \u0442\u0430\u043a \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u043c\u0433\u043d\u043e\u0432\u0435\u043d\u043d\u043e, \u0438\u0437\u0431\u044b\u0442\u043e\u0447\u043d\u043e \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u0442\u044c \u043d\u043e\u0432\u0443\u044e \u043b\u043e\u0433\u0438\u043a\u0443 \u043f\u0440\u0438\u043e\u0440\u0438\u0442\u0438\u0437\u0430\u0446\u0438\u0438.<\/p>\n<\/li>\n<li>\n<p>\u0414\u043b\u044f \u043f\u0440\u043e\u0441\u0442\u044b\u0445 \u0441\u0438\u043d\u0445\u0440\u043e\u043d\u043d\u044b\u0445 \u043e\u0431\u043d\u043e\u0432\u043b\u0435\u043d\u0438\u0439. \u0415\u0441\u043b\u0438 \u0437\u0430\u0434\u0430\u0447\u0430 &#8212; \u043f\u0440\u043e\u0441\u0442\u043e \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u044d\u043b\u0435\u043c\u0435\u043d\u0442 \u0432 \u043c\u0430\u0441\u0441\u0438\u0432, \u0438 \u0432\u0440\u0435\u043c\u044f \u043e\u0431\u043d\u043e\u0432\u043b\u0435\u043d\u0438\u044f \u043c\u0438\u0437\u0435\u0440\u043d\u043e\u0435, <code>useTransition<\/code> \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c \u043b\u0438\u0448\u043d\u0438\u043c.<\/p>\n<\/li>\n<li>\n<p><code>useOptimistic<\/code>: \u043f\u043e\u0434\u0445\u043e\u0434\u0438\u0442 \u0434\u043b\u044f \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f \u0432 \u043f\u0440\u043e\u0434\u0430\u043a\u0448\u043d-\u043f\u0440\u043e\u0435\u043a\u0442\u0430\u0445, \u043d\u043e \u0432 \u0441\u043b\u043e\u0436\u043d\u044b\u0445 \u0441\u043b\u0443\u0447\u0430\u044f\u0445 \u0441 \u0441\u043f\u0435\u0446\u0438\u0444\u0438\u0447\u043d\u043e\u0439 \u043b\u043e\u0433\u0438\u043a\u043e\u0439 \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0438 \u043e\u0448\u0438\u0431\u043e\u043a \u043c\u043e\u0436\u043d\u043e \u0440\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0435\u0442\u044c \u0430\u043b\u044c\u0442\u0435\u0440\u043d\u0430\u0442\u0438\u0432\u044b, \u0442\u0430\u043a\u0438\u0435 \u043a\u0430\u043a React Query \u0438\u043b\u0438 RTK Query, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0442\u0430\u043a\u0436\u0435 \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u044e\u0442 \u043e\u043f\u0442\u0438\u043c\u0438\u0441\u0442\u0438\u0447\u043d\u044b\u0435 \u043e\u0431\u043d\u043e\u0432\u043b\u0435\u043d\u0438\u044f. <\/p>\n<\/li>\n<\/ul>\n<h3>\u0418\u0442\u043e\u0433\u0438<\/h3>\n<ul>\n<li>\n<p><code>useTransition<\/code>: \u041e\u0431\u043e\u0440\u0430\u0447\u0438\u0432\u0430\u0435\u043c \u043d\u0435\u043a\u0440\u0438\u0442\u0438\u0447\u0435\u0441\u043a\u0438\u0435 \u043e\u0431\u043d\u043e\u0432\u043b\u0435\u043d\u0438\u044f \u0441\u0442\u0435\u0439\u0442\u0430, \u0447\u0442\u043e\u0431\u044b \u0440\u0435\u043d\u0434\u0435\u0440\u044b \u043f\u043e\u043d\u0438\u0436\u0435\u043d\u043d\u043e\u0433\u043e \u043f\u0440\u0438\u043e\u0440\u0438\u0442\u0435\u0442\u0430 \u043d\u0435 \u0431\u043b\u043e\u043a\u0438\u0440\u043e\u0432\u0430\u043b\u0438 \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441.<\/p>\n<\/li>\n<li>\n<p><code>useDeferredValue<\/code>: \u0414\u0430\u0451\u043c React \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044c \u043e\u0442\u043b\u043e\u0436\u0435\u043d\u043d\u043e \u043e\u0431\u043d\u043e\u0432\u043b\u044f\u0442\u044c \u0442\u044f\u0436\u0451\u043b\u043e\u0435 \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u0435 &#8212; \u0443\u0434\u043e\u0431\u043d\u043e \u0432 \u0441\u0432\u044f\u0437\u043a\u0435 \u0441 \u0444\u043e\u0440\u043c\u0430\u043c\u0438, \u043f\u043e\u0438\u0441\u043a\u043e\u043c \u0438 \u0431\u043e\u043b\u044c\u0448\u0438\u043c\u0438 \u0441\u043f\u0438\u0441\u043a\u0430\u043c\u0438.<\/p>\n<\/li>\n<li>\n<p><code>useOptimistic<\/code>: \u0423\u043f\u0440\u043e\u0449\u0430\u0435\u0442 \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044e \u043e\u043f\u0442\u0438\u043c\u0438\u0441\u0442\u0438\u0447\u043d\u044b\u0445 \u043e\u0431\u043d\u043e\u0432\u043b\u0435\u043d\u0438\u0439, \u043a\u043e\u0433\u0434\u0430 \u043d\u0443\u0436\u043d\u043e \u043c\u0433\u043d\u043e\u0432\u0435\u043d\u043d\u043e \u043f\u043e\u043a\u0430\u0437\u044b\u0432\u0430\u0442\u044c \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442 \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0439 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f, \u0430 \u043f\u0440\u0438 \u0441\u0431\u043e\u0435 &#8212; \u043e\u0442\u043c\u0435\u043d\u044f\u0442\u044c.<\/p>\n<\/li>\n<\/ul>\n<p>\u0412 \u0431\u043b\u0438\u0436\u0430\u0439\u0448\u0438\u0445 \u043f\u0443\u0431\u043b\u0438\u043a\u0430\u0446\u0438\u044f\u0445 \u044f \u0440\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u044e \u043a\u0430\u0436\u0434\u044b\u0439 \u0438\u0437 \u0445\u0443\u043a\u043e\u0432 \u043f\u043e\u0434\u0440\u043e\u0431\u043d\u0435\u0435:<\/p>\n<ul>\n<li>\n<p><code>useTransition<\/code>: \u043f\u0440\u043e\u0434\u0432\u0438\u043d\u0443\u0442\u044b\u0435 \u043f\u0430\u0442\u0442\u0435\u0440\u043d\u044b<\/p>\n<ul>\n<li>\n<p>\u041a\u0430\u043a \u043e\u0442\u043c\u0435\u043d\u044f\u0442\u044c\/\u043f\u0435\u0440\u0435\u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0442\u044c \u043f\u0435\u0440\u0435\u0445\u043e\u0434\u044b, \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u043f\u0430\u0440\u0430\u043b\u043b\u0435\u043b\u044c\u043d\u044b\u0445 \u043f\u0435\u0440\u0435\u0445\u043e\u0434\u043e\u0432, \u043a\u0435\u0439\u0441\u044b \u0441 \u0430\u043d\u0438\u043c\u0430\u0446\u0438\u044f\u043c\u0438.<\/p>\n<\/li>\n<\/ul>\n<\/li>\n<li>\n<p><code>useDeferredValue<\/code>: \u043e\u0442 \u0442\u0435\u043e\u0440\u0438\u0438 \u043a \u043f\u0440\u0430\u043a\u0442\u0438\u043a\u0435<\/p>\n<ul>\n<li>\n<p>\u0420\u0430\u0437\u0431\u043e\u0440 edge-case\u2019\u043e\u0432, \u0437\u0430\u043c\u0435\u0440\u044b \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u0438, \u0442\u043e\u043d\u043a\u043e\u0441\u0442\u0438 \u0432 \u0441\u043e\u0447\u0435\u0442\u0430\u043d\u0438\u0438 \u0441 <code>useMemo<\/code> \u0438 <code>useCallback<\/code>.<\/p>\n<\/li>\n<\/ul>\n<\/li>\n<li>\n<p><code>useOptimistic<\/code>: \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f \u0441\u043b\u043e\u0436\u043d\u044b\u0445 \u0441\u0446\u0435\u043d\u0430\u0440\u0438\u0435\u0432<\/p>\n<ul>\n<li>\n<p>\u041d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u043f\u0430\u0440\u0430\u043b\u043b\u0435\u043b\u044c\u043d\u044b\u0445 \u043e\u043f\u0442\u0438\u043c\u0438\u0441\u0442\u0438\u0447\u043d\u044b\u0445 \u043e\u0431\u043d\u043e\u0432\u043b\u0435\u043d\u0438\u0439, \u043e\u0442\u043a\u0430\u0442\u044b, \u0438\u043d\u0442\u0435\u0433\u0440\u0430\u0446\u0438\u044f \u0441 Redux\/RTK Query \u0438 \u0442.\u0434.<\/p>\n<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<p>\u041d\u0430\u0434\u0435\u044e\u0441\u044c, \u044d\u0442\u0430 \u0441\u0442\u0430\u0442\u044c\u044f \u043f\u043e\u043c\u043e\u0436\u0435\u0442 \u0432\u0430\u043c \u0443\u043b\u0443\u0447\u0448\u0438\u0442\u044c \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u044c \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441\u043e\u0432. \u0414\u0430\u0436\u0435 \u0435\u0441\u043b\u0438 \u0432 \u0432\u0430\u0448\u0435\u043c \u043f\u0440\u043e\u0435\u043a\u0442\u0435 \u043d\u0435\u0442 \u043f\u043e\u0442\u0440\u0435\u0431\u043d\u043e\u0441\u0442\u0438 \u0432 \u0441\u043b\u043e\u0436\u043d\u043e\u0439 \u043e\u043f\u0442\u0438\u043c\u0438\u0437\u0430\u0446\u0438\u0438, \u0437\u043d\u0430\u043d\u0438\u0435 \u0445\u0443\u043a\u043e\u0432 <code>useTransition<\/code>, <code>useDeferredValue<\/code> \u0438 <code>useOptimistic<\/code> \u043f\u043e\u043c\u043e\u0436\u0435\u0442 \u0432\u0430\u043c \u0431\u044b\u0441\u0442\u0440\u043e \u0443\u043b\u0443\u0447\u0448\u0438\u0442\u044c \u043e\u0442\u0437\u044b\u0432\u0447\u0438\u0432\u043e\u0441\u0442\u044c UI \u0432 \u043d\u0443\u0436\u043d\u044b\u0439 \u043c\u043e\u043c\u0435\u043d\u0442.<\/p>\n<p>\u0414\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u043e, \u0435\u0441\u043b\u0438 \u0432\u0430\u043c \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u0430 \u0442\u0435\u043c\u0430 \u0443\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u044f \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u0435\u043c \u0432 React, \u0440\u0435\u043a\u043e\u043c\u0435\u043d\u0434\u0443\u044e \u043e\u0437\u043d\u0430\u043a\u043e\u043c\u0438\u0442\u044c\u0441\u044f \u0441 \u043c\u043e\u0435\u0439 \u0441\u0442\u0430\u0442\u044c\u0451\u0439 \u043d\u0430 <a href=\"https:\/\/habr.com\/ru\/articles\/870216\/\" rel=\"noopener noreferrer nofollow\">Habr<\/a>, \u0433\u0434\u0435 \u044f \u043f\u043e\u0434\u0440\u043e\u0431\u043d\u0435\u0435 \u0440\u0430\u0441\u0441\u043a\u0430\u0437\u044b\u0432\u0430\u044e \u043e \u0445\u0443\u043a\u0435 <code>useActionState<\/code> \u0438 \u0435\u0433\u043e \u043f\u0440\u0438\u043c\u0435\u043d\u0435\u043d\u0438\u0438.<\/p>\n<\/p>\n<\/div>\n<\/div>\n<\/div>\n<p><!----><!----><\/div>\n<p><!----><!----><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\/articles\/870748\/\"> https:\/\/habr.com\/ru\/articles\/870748\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<div><!--[--><!--]--><\/div>\n<div id=\"post-content-body\">\n<div>\n<div class=\"article-formatted-body article-formatted-body article-formatted-body_version-2\">\n<div xmlns=\"http:\/\/www.w3.org\/1999\/xhtml\">\n<figure class=\"full-width\">\n<div><figcaption> \u0418\u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u0435, \u0441\u043e\u0437\u0434\u0430\u043d\u043d\u043e\u0435 DALL-E  <\/figcaption><\/div>\n<\/figure>\n<p>\u0412\u0435\u0431-\u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u0441\u0435\u0433\u043e\u0434\u043d\u044f \u0442\u0440\u0435\u0431\u0443\u044e\u0442 \u0432\u0441\u0451 \u0431\u043e\u043b\u044c\u0448\u0435\u0439 \u0438\u043d\u0442\u0435\u0440\u0430\u043a\u0442\u0438\u0432\u043d\u043e\u0441\u0442\u0438, \u043e\u0442\u0437\u044b\u0432\u0447\u0438\u0432\u043e\u0441\u0442\u0438 \u0438 \u0431\u044b\u0441\u0442\u0440\u043e\u0434\u0435\u0439\u0441\u0442\u0432\u0438\u044f. \u0412 \u043e\u0442\u0432\u0435\u0442 \u043d\u0430 \u044d\u0442\u043e \u043a\u043e\u043c\u0430\u043d\u0434\u0430 React \u043f\u043e\u0441\u0442\u043e\u044f\u043d\u043d\u043e \u0441\u043e\u0432\u0435\u0440\u0448\u0435\u043d\u0441\u0442\u0432\u0443\u0435\u0442 \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442\u0430\u0440\u0438\u0439, \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u044e\u0449\u0438\u0439 \u043d\u0430\u043c \u0442\u043e\u043d\u043a\u043e \u0443\u043f\u0440\u0430\u0432\u043b\u044f\u0442\u044c \u0440\u0435\u043d\u0434\u0435\u0440\u0438\u043d\u0433\u043e\u043c \u0438 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u0441\u043a\u0438\u043c \u043e\u043f\u044b\u0442\u043e\u043c. \u0415\u0441\u043b\u0438 \u0432\u044b \u0440\u0430\u0431\u043e\u0442\u0430\u043b\u0438 \u0442\u043e\u043b\u044c\u043a\u043e \u0441 \u043a\u043b\u0430\u0441\u0441\u0438\u0447\u0435\u0441\u043a\u0438\u043c\u0438 \u043c\u0435\u0442\u043e\u0434\u0430\u043c\u0438 \u043e\u043f\u0442\u0438\u043c\u0438\u0437\u0430\u0446\u0438\u0438 \u0432\u0440\u043e\u0434\u0435 <code>useMemo<\/code>, <code>useCallback<\/code>, \u043c\u0435\u043c\u043e\u0438\u0437\u0430\u0446\u0438\u0438 \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442 \u0447\u0435\u0440\u0435\u0437 <code>React.memo<\/code> \u0438 \u0434\u0440\u0443\u0433\u0438\u043c\u0438 \u0438\u0437\u0432\u0435\u0441\u0442\u043d\u044b\u043c\u0438 \u043f\u0440\u0438\u0451\u043c\u0430\u043c\u0438, \u0442\u043e \u0432\u0430\u0441 \u043c\u043e\u0433\u0443\u0442 \u0437\u0430\u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043e\u0432\u0430\u0442\u044c \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0435 \u0445\u0443\u043a\u0438:<\/p>\n<ol>\n<li>\n<p><code>useTransition<\/code> &#8212; \u0443\u0441\u0442\u0430\u043d\u0430\u0432\u043b\u0438\u0432\u0430\u0435\u0442 \u043f\u0440\u0438\u043e\u0440\u0438\u0442\u0435\u0442\u044b \u0440\u0435\u043d\u0434\u0435\u0440\u0438\u043d\u0433\u0430, \u0440\u0430\u0437\u0434\u0435\u043b\u044f\u044f \u043e\u0431\u043d\u043e\u0432\u043b\u0435\u043d\u0438\u044f \u043d\u0430 \u043a\u0440\u0438\u0442\u0438\u0447\u0435\u0441\u043a\u0438\u0435 \u0438 \u0444\u043e\u043d\u043e\u0432\u044b\u0435.<\/p>\n<\/li>\n<li>\n<p><code>useDeferredValue<\/code> &#8212; \u043e\u0442\u043a\u043b\u0430\u0434\u044b\u0432\u0430\u0435\u0442 \u043e\u0431\u043d\u043e\u0432\u043b\u0435\u043d\u0438\u0435 \u0442\u044f\u0436\u0451\u043b\u044b\u0445 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0439, \u0447\u0442\u043e\u0431\u044b \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441 \u043d\u0435 \u0444\u0440\u0438\u0437\u0438\u043b\u0441\u044f \u043f\u0440\u0438 \u0432\u0432\u043e\u0434\u0435 \u0434\u0430\u043d\u043d\u044b\u0445.<\/p>\n<\/li>\n<li>\n<p><code>useOptimistic<\/code> &#8212; \u043f\u043e\u043c\u043e\u0433\u0430\u0435\u0442 \u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u0442\u044c \u043e\u043f\u0442\u0438\u043c\u0438\u0441\u0442\u0438\u0447\u043d\u044b\u0435 \u043e\u0431\u043d\u043e\u0432\u043b\u0435\u043d\u0438\u044f &#171;\u0438\u0437 \u043a\u043e\u0440\u043e\u0431\u043a\u0438&#187;.<\/p>\n<\/li>\n<\/ol>\n<p>\u0412 \u044d\u0442\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0435 \u043c\u044b \u0440\u0430\u0437\u0431\u0435\u0440\u0451\u043c \u043a\u043b\u044e\u0447\u0435\u0432\u044b\u0435 \u0438\u0434\u0435\u0438 \u043a\u0430\u0436\u0434\u043e\u0433\u043e \u0438\u0437 \u044d\u0442\u0438\u0445 \u0445\u0443\u043a\u043e\u0432 \u0438 \u0440\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u043f\u0440\u0430\u043a\u0442\u0438\u0447\u0435\u0441\u043a\u0438\u0435 \u043f\u0440\u0438\u043c\u0435\u0440\u044b, \u0447\u0442\u043e\u0431\u044b \u0441\u0442\u0430\u043b\u043e \u044f\u0441\u043d\u043e, \u043a\u0430\u043a \u0438 \u043a\u043e\u0433\u0434\u0430 \u0438\u0445 \u043f\u0440\u0438\u043c\u0435\u043d\u044f\u0442\u044c.<\/p>\n<h3>useTransition: \u043f\u0440\u0438\u043e\u0440\u0438\u0442\u0435\u0442\u044b \u0440\u0435\u043d\u0434\u0435\u0440\u0438\u043d\u0433\u0430 \u0438 \u043f\u043b\u0430\u0432\u043d\u043e\u0441\u0442\u044c UI<\/h3>\n<h3>\u041e\u0431\u0449\u0430\u044f \u0438\u0434\u0435\u044f<\/h3>\n<p>\u041a\u043e\u0433\u0434\u0430 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c \u0441\u043e\u0432\u0435\u0440\u0448\u0430\u0435\u0442 \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0435 (\u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u0432\u0432\u043e\u0434\u0438\u0442 \u0442\u0435\u043a\u0441\u0442, \u043f\u0435\u0440\u0435\u043a\u043b\u044e\u0447\u0430\u0435\u0442 \u0432\u043a\u043b\u0430\u0434\u043a\u0438, \u0436\u043c\u0451\u0442 \u043a\u043d\u043e\u043f\u043a\u0443), \u043d\u0430\u043c \u043c\u043e\u0436\u0435\u0442 \u043f\u043e\u043d\u0430\u0434\u043e\u0431\u0438\u0442\u044c\u0441\u044f \u0432\u044b\u043f\u043e\u043b\u043d\u0438\u0442\u044c \u0434\u043e\u0432\u043e\u043b\u044c\u043d\u043e \u0442\u044f\u0436\u0435\u043b\u043e\u0435 \u043e\u0431\u043d\u043e\u0432\u043b\u0435\u043d\u0438\u0435 \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u044f: \u0444\u0438\u043b\u044c\u0442\u0440\u0430\u0446\u0438\u044f \u0431\u043e\u043b\u044c\u0448\u043e\u0439 \u043a\u043e\u043b\u043b\u0435\u043a\u0446\u0438\u0438, \u043f\u0435\u0440\u0435\u0441\u0447\u0451\u0442 \u0441\u043b\u043e\u0436\u043d\u044b\u0445 \u0434\u0430\u043d\u043d\u044b\u0445, \u043f\u0435\u0440\u0435\u0441\u0442\u0440\u043e\u0439\u043a\u0430 \u0442\u0430\u0431\u043b\u0438\u0446\u044b \u0438 \u0442.\u0434. \u0415\u0441\u043b\u0438 \u0432\u0441\u0451 \u044d\u0442\u043e \u043f\u0440\u043e\u0438\u0437\u043e\u0439\u0434\u0451\u0442 \u0441\u0440\u0430\u0437\u0443 (\u0441 \u0432\u044b\u0441\u043e\u043a\u0438\u043c \u043f\u0440\u0438\u043e\u0440\u0438\u0442\u0435\u0442\u043e\u043c), \u0442\u043e UI \u043c\u043e\u0436\u0435\u0442 \u043f\u043e\u0434\u0432\u0438\u0441\u043d\u0443\u0442\u044c \u043d\u0430 \u0441\u0435\u043a\u0443\u043d\u0434\u0443 &#8212; \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c \u0443\u0432\u0438\u0434\u0438\u0442 \u0437\u0430\u0434\u0435\u0440\u0436\u043a\u0443 \u043f\u0440\u0438 \u043d\u0430\u0436\u0430\u0442\u0438\u0438 \u0438\u043b\u0438 \u0432\u0432\u043e\u0434\u0435 \u0442\u0435\u043a\u0441\u0442\u0430.<\/p>\n<p>\u0412 React 18 \u043f\u043e\u044f\u0432\u0438\u043b\u0441\u044f \u0445\u0443\u043a <code>useTransition<\/code>, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u043f\u043e\u043c\u0435\u0442\u0438\u0442\u044c \u043a\u0430\u043a\u043e\u0435-\u0442\u043e \u043e\u0431\u043d\u043e\u0432\u043b\u0435\u043d\u0438\u0435 \u043a\u0430\u043a &#171;\u043d\u0435\u043a\u0440\u0438\u0442\u0438\u0447\u043d\u043e\u0435&#187; \u0438\u043b\u0438 &#171;\u043f\u0435\u0440\u0435\u0445\u043e\u0434\u043d\u043e\u0435&#187;. \u041f\u0440\u0438 \u044d\u0442\u043e\u043c \u043a\u043b\u044e\u0447\u0435\u0432\u044b\u0435 \u043c\u043e\u043c\u0435\u043d\u0442\u044b \u0432\u0437\u0430\u0438\u043c\u043e\u0434\u0435\u0439\u0441\u0442\u0432\u0438\u044f \u0441 \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441\u043e\u043c (\u043a\u043b\u0438\u043a, \u0432\u0432\u043e\u0434) \u043e\u0441\u0442\u0430\u044e\u0442\u0441\u044f \u043e\u0442\u0437\u044b\u0432\u0447\u0438\u0432\u044b\u043c\u0438, \u0430 \u0441\u0430\u043c\u043e \u0442\u044f\u0436\u0451\u043b\u043e\u0435 \u043e\u0431\u043d\u043e\u0432\u043b\u0435\u043d\u0438\u0435 \u043c\u043e\u0436\u0435\u0442 \u043f\u0440\u043e\u0438\u0441\u0445\u043e\u0434\u0438\u0442\u044c \u0447\u0443\u0442\u044c \u043f\u043e\u0437\u0436\u0435 \u0438\u043b\u0438 \u0432 \u0444\u043e\u043d\u043e\u0432\u043e\u043c \u0440\u0435\u0436\u0438\u043c\u0435.<\/p>\n<h4>\u041a\u0430\u043a \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c\u0441\u044f: \u0431\u0430\u0437\u043e\u0432\u044b\u0439 \u043f\u0440\u0438\u043c\u0435\u0440<\/h4>\n<p>\u0412 \u044d\u0442\u043e\u043c \u043f\u0440\u0438\u043c\u0435\u0440\u0435, \u043f\u0440\u0438 \u0432\u0432\u043e\u0434\u0435 \u0442\u0435\u043a\u0441\u0442\u0430, \u043f\u043e\u043b\u0435 \u0432\u0432\u043e\u0434\u0430 \u043e\u0431\u043d\u043e\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u043c\u0433\u043d\u043e\u0432\u0435\u043d\u043d\u043e, \u0447\u0442\u043e\u0431\u044b \u0431\u044b\u0442\u044c \u043e\u0442\u0437\u044b\u0432\u0447\u0438\u0432\u044b\u043c, \u043d\u043e \u0444\u0438\u043b\u044c\u0442\u0440\u0430\u0446\u0438\u044f \u0431\u043e\u043b\u044c\u0448\u043e\u0433\u043e \u0441\u043f\u0438\u0441\u043a\u0430 (filteredItems) \u043e\u0431\u043e\u0440\u0430\u0447\u0438\u0432\u0430\u0435\u0442\u0441\u044f \u0432 <code>startTransition<\/code>, \u0447\u0442\u043e \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 React &#171;\u043f\u0440\u0438\u043e\u0441\u0442\u0430\u043d\u0430\u0432\u043b\u0438\u0432\u0430\u0442\u044c&#187; \u0432\u044b\u0447\u0438\u0441\u043b\u0435\u043d\u0438\u044f, \u0435\u0441\u043b\u0438 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c \u0432\u0432\u043e\u0434\u0438\u0442 \u043c\u043d\u043e\u0433\u043e \u0441\u0438\u043c\u0432\u043e\u043b\u043e\u0432 \u043f\u043e\u0434\u0440\u044f\u0434. \u042d\u0442\u043e \u043f\u043e\u043c\u043e\u0433\u0430\u0435\u0442 \u0438\u0437\u0431\u0435\u0436\u0430\u0442\u044c \u0437\u0430\u0434\u0435\u0440\u0436\u0435\u043a \u0432 \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441\u0435. \u0418\u043d\u0434\u0438\u043a\u0430\u0442\u043e\u0440 \u0437\u0430\u0433\u0440\u0443\u0437\u043a\u0438 \u043e\u0442\u043e\u0431\u0440\u0430\u0436\u0430\u0435\u0442\u0441\u044f, \u043f\u043e\u043a\u0430 \u043f\u0440\u043e\u0446\u0435\u0441\u0441 \u0444\u0438\u043b\u044c\u0442\u0440\u0430\u0446\u0438\u0438 \u043d\u0435 \u0437\u0430\u0432\u0435\u0440\u0448\u0438\u0442\u0441\u044f.  <\/p>\n<pre><code class=\"javascript\">import React, { useState, useTransition } from 'react';  function BigList({ items }) {   return (     &lt;ul&gt;       {items.map((item) =&gt; (         &lt;li key={item.id}&gt;{item.text}&lt;\/li&gt;       ))}     &lt;\/ul&gt;   ); }  export default function App() {   const [text, setText] = useState('');   const [filteredItems, setFilteredItems] = useState([]);   const [isPending, startTransition] = useTransition(); \/\/ \u0425\u0443\u043a useTransition    \/\/ \u0414\u043e\u043f\u0443\u0441\u0442\u0438\u043c, \u0443 \u043d\u0430\u0441 \u0435\u0441\u0442\u044c \u0431\u043e\u043b\u044c\u0448\u0430\u044f \u043a\u043e\u043b\u043b\u0435\u043a\u0446\u0438\u044f   const allItems = Array.from({ length: 10000 }, (_, i) =&gt; ({     id: i,     text: `Item ${i}`   }));    const handleInputChange = (e) =&gt; {     const value = e.target.value;     setText(value);      \/\/ \u041d\u0435\u043a\u0440\u0438\u0442\u0438\u0447\u043d\u043e\u0435 \u043e\u0431\u043d\u043e\u0432\u043b\u0435\u043d\u0438\u0435 \u0432\u044b\u043d\u0435\u0441\u0435\u043c \u0432 startTransition     startTransition(() =&gt; {       const filtered = allItems.filter((item) =&gt;         item.text.toLowerCase().includes(value.toLowerCase())       );       setFilteredItems(filtered);     });   };    return (     &lt;div&gt;       &lt;h1&gt;\u0421\u043f\u0438\u0441\u043e\u043a: {filteredItems.length} \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u043e\u0432&lt;\/h1&gt;       &lt;input         value={text}         onChange={handleInputChange}         placeholder=\"\u041f\u043e\u0438\u0441\u043a \u043f\u043e \u0441\u043f\u0438\u0441\u043a\u0443...\"       \/&gt;       {\/* \u041f\u043e\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u043c \u0438\u043d\u0434\u0438\u043a\u0430\u0442\u043e\u0440, \u0435\u0441\u043b\u0438 useTransition \u0435\u0449\u0451 \"\u0432 \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u0435\" *\/}       {isPending &amp;&amp; &lt;p&gt;Loading...&lt;\/p&gt;}        &lt;BigList items={filteredItems} \/&gt;     &lt;\/div&gt;   ); }<\/code><\/pre>\n<h4>\u041a\u0430\u043a \u044d\u0442\u043e \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442?<\/h4>\n<ul>\n<li>\n<p>\u041f\u0440\u0438 \u043a\u0430\u0436\u0434\u043e\u043c \u0432\u0432\u043e\u0434\u0435 \u0441\u0438\u043c\u0432\u043e\u043b\u0430 \u043c\u044b \u0441\u0440\u0430\u0437\u0443 \u043e\u0431\u043d\u043e\u0432\u043b\u044f\u0435\u043c <code>text<\/code> (\u0447\u0442\u043e\u0431\u044b \u043f\u043e\u043b\u0435 \u0432\u0432\u043e\u0434\u0430 \u0431\u044b\u043b\u043e \u043e\u0442\u0437\u044b\u0432\u0447\u0438\u0432\u044b\u043c).<\/p>\n<\/li>\n<li>\n<p>\u041d\u043e \u043f\u0435\u0440\u0435\u0441\u0447\u0451\u0442 \u0431\u043e\u043b\u044c\u0448\u043e\u0433\u043e \u0441\u043f\u0438\u0441\u043a\u0430 (<code>filteredItems<\/code>) \u043e\u0431\u043e\u0440\u0430\u0447\u0438\u0432\u0430\u0435\u043c \u0432 <code>startTransition(...)<\/code>.<\/p>\n<\/li>\n<li>\n<p>\u0415\u0441\u043b\u0438 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c \u0432\u0432\u043e\u0434\u0438\u0442 \u043c\u043d\u043e\u0433\u043e \u0441\u0438\u043c\u0432\u043e\u043b\u043e\u0432 \u043f\u043e\u0434\u0440\u044f\u0434 \u0431\u044b\u0441\u0442\u0440\u043e, React \u043c\u043e\u0436\u0435\u0442 \u043f\u0440\u0438\u043e\u0441\u0442\u0430\u043d\u0430\u0432\u043b\u0438\u0432\u0430\u0442\u044c \u0432\u044b\u0447\u0438\u0441\u043b\u0435\u043d\u0438\u044f \u0438 \u043e\u0431\u043d\u043e\u0432\u043b\u044f\u0442\u044c \u0441\u043f\u0438\u0441\u043e\u043a, \u0442\u043e\u043b\u044c\u043a\u043e \u043a\u043e\u0433\u0434\u0430 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c \u043f\u0440\u0438\u0442\u043e\u0440\u043c\u043e\u0437\u0438\u0442 \u0441 \u0432\u0432\u043e\u0434\u043e\u043c &#8212; \u0447\u0442\u043e\u0431\u044b UI \u043e\u0441\u0442\u0430\u0432\u0430\u043b\u0441\u044f \u043f\u043b\u0430\u0432\u043d\u044b\u043c.<\/p>\n<\/li>\n<li>\n<p><code>isPending<\/code> \u0433\u043e\u0432\u043e\u0440\u0438\u0442, \u0447\u0442\u043e &#171;\u043f\u0435\u0440\u0435\u0445\u043e\u0434&#187; \u0435\u0449\u0451 \u0438\u0434\u0451\u0442, \u0438 \u043c\u043e\u0436\u043d\u043e \u043f\u043e\u043a\u0430\u0437\u044b\u0432\u0430\u0442\u044c \u0438\u043d\u0434\u0438\u043a\u0430\u0442\u043e\u0440 \u0437\u0430\u0433\u0440\u0443\u0437\u043a\u0438.<\/p>\n<\/li>\n<\/ul>\n<h4>\u041a\u0430\u043a\u0438\u0435 \u0437\u0430\u0434\u0430\u0447\u0438 \u0440\u0435\u0448\u0430\u0435\u0442 useTransition?<\/h4>\n<ul>\n<li>\n<p><strong>\u0424\u0438\u043b\u044c\u0442\u0440\u0430\u0446\u0438\u044f\/\u0441\u043e\u0440\u0442\u0438\u0440\u043e\u0432\u043a\u0430<\/strong> \u0431\u043e\u043b\u044c\u0448\u0438\u0445 \u0441\u043f\u0438\u0441\u043a\u043e\u0432.<\/p>\n<\/li>\n<li>\n<p><strong>\u041f\u0435\u0440\u0435\u0440\u0438\u0441\u043e\u0432\u043a\u0430<\/strong> \u0441\u043b\u043e\u0436\u043d\u044b\u0445 \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442 (\u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u043a\u0430\u0440\u0442 \u0441 \u043c\u043d\u043e\u0436\u0435\u0441\u0442\u0432\u043e\u043c \u043e\u0431\u044a\u0435\u043a\u0442\u043e\u0432).<\/p>\n<\/li>\n<li>\n<p><strong>\u041f\u043b\u0430\u0432\u043d\u044b\u0435 \u0430\u043d\u0438\u043c\u0430\u0446\u0438\u0438<\/strong> \u043f\u0440\u0438 \u043f\u0435\u0440\u0435\u0445\u043e\u0434\u0435 \u043c\u0435\u0436\u0434\u0443 \u044d\u043a\u0440\u0430\u043d\u0430\u043c\u0438 \u0438\u043b\u0438 \u0432\u043a\u043b\u0430\u0434\u043a\u0430\u043c\u0438.<\/p>\n<\/li>\n<\/ul>\n<h4>\u041f\u043e\u0434\u0432\u043e\u0434\u043d\u044b\u0435 \u043a\u0430\u043c\u043d\u0438 \u0438 \u0437\u0430\u043c\u0435\u0447\u0430\u043d\u0438\u044f<\/h4>\n<ul>\n<li>\n<p><code>useTransition<\/code> \u043d\u0435 \u043e\u0442\u043c\u0435\u043d\u044f\u0435\u0442 \u0441\u0430\u043c\u043e \u0432\u044b\u0447\u0438\u0441\u043b\u0435\u043d\u0438\u0435; \u043e\u043d\u043e \u043f\u0440\u043e\u0441\u0442\u043e \u0434\u0430\u0451\u0442 React \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044c \u043e\u043f\u0442\u0438\u043c\u0430\u043b\u044c\u043d\u0435\u0435 \u0440\u0430\u0441\u043f\u0440\u0435\u0434\u0435\u043b\u044f\u0442\u044c \u043f\u0440\u0438\u043e\u0440\u0438\u0442\u0435\u0442\u044b.<\/p>\n<\/li>\n<li>\n<p>\u0415\u0441\u043b\u0438 \u0443 \u0432\u0430\u0441 \u043e\u0447\u0435\u043d\u044c \u0442\u044f\u0436\u0451\u043b\u0430\u044f \u043b\u043e\u0433\u0438\u043a\u0430, \u043c\u043e\u0436\u0435\u0442 \u043f\u043e\u0442\u0440\u0435\u0431\u043e\u0432\u0430\u0442\u044c\u0441\u044f \u0434\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u0430\u044f \u043e\u043f\u0442\u0438\u043c\u0438\u0437\u0430\u0446\u0438\u044f (\u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u043c\u0435\u043c\u043e\u0438\u0437\u0430\u0446\u0438\u044f \u0438\u043b\u0438 \u0432\u044b\u043d\u0435\u0441\u0435\u043d\u0438\u0435 \u0432\u044b\u0447\u0438\u0441\u043b\u0435\u043d\u0438\u0439 \u043d\u0430 Web Worker).<\/p>\n<\/li>\n<li>\n<p>\u041d\u0435 \u0437\u043b\u043e\u0443\u043f\u043e\u0442\u0440\u0435\u0431\u043b\u044f\u0439\u0442\u0435 <code>useTransition<\/code>: \u0435\u0441\u043b\u0438 \u0432\u0441\u0435 \u043e\u0431\u043d\u043e\u0432\u043b\u0435\u043d\u0438\u044f \u043f\u043e\u043c\u0435\u0447\u0430\u0442\u044c \u043a\u0430\u043a &#171;\u043d\u0435\u043a\u0440\u0438\u0442\u0438\u0447\u043d\u044b\u0435&#187;, \u0442\u043e \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u0438 \u0431\u0443\u0434\u0443\u0442 \u0432\u0438\u0434\u0435\u0442\u044c \u0437\u0430\u0434\u0435\u0440\u0436\u043a\u0438.<\/p>\n<\/li>\n<\/ul>\n<h3>useDeferredValue: \u043b\u0435\u043d\u0438\u0432\u043e\u0435 \u043e\u0431\u043d\u043e\u0432\u043b\u0435\u043d\u0438\u0435 \u0431\u043e\u043b\u044c\u0448\u0438\u0445 \u0434\u0430\u043d\u043d\u044b\u0445<\/h3>\n<h4>\u0412 \u0447\u0451\u043c \u0441\u0443\u0442\u044c?<\/h4>\n<p><code>useDeferredValue<\/code> &#8212; \u0435\u0449\u0451 \u043e\u0434\u0438\u043d \u0445\u0443\u043a, \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u043d\u044b\u0439 \u0432 React 18, \u0440\u0435\u0448\u0430\u0435\u0442 \u043f\u043e\u0445\u043e\u0436\u0443\u044e \u0437\u0430\u0434\u0430\u0447\u0443 \u043e\u043f\u0442\u0438\u043c\u0438\u0437\u0430\u0446\u0438\u0438. \u041d\u043e \u0437\u0434\u0435\u0441\u044c \u043c\u044b \u0438\u043c\u0435\u0435\u043c \u0434\u0435\u043b\u043e \u043d\u0435 \u0441 \u0440\u0430\u0437\u043c\u0435\u0442\u043a\u043e\u0439 \u043e\u0431\u043d\u043e\u0432\u043b\u0435\u043d\u0438\u044f (\u043a\u0430\u043a \u0432 <code>useTransition<\/code>), \u0430 \u0441 &#171;\u0434\u0432\u043e\u0439\u043d\u044b\u043c&#187; \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u0435\u043c:<\/p>\n<ul>\n<li>\n<p><strong>\u041e\u0441\u043d\u043e\u0432\u043d\u043e\u0435 \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u0435<\/strong>, \u043a\u043e\u0442\u043e\u0440\u043e\u0435 \u043e\u0431\u043d\u043e\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0441\u0440\u0430\u0437\u0443.<\/p>\n<\/li>\n<li>\n<p><strong>\u041e\u0442\u043b\u043e\u0436\u0435\u043d\u043d\u043e\u0435 \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u0435<\/strong>, \u043a\u043e\u0442\u043e\u0440\u043e\u0435 \u043c\u043e\u0436\u0435\u0442 \u043e\u0431\u043d\u043e\u0432\u043b\u044f\u0442\u044c\u0441\u044f \u0447\u0443\u0442\u044c \u043f\u043e\u0437\u0436\u0435, \u0441 \u043c\u0435\u043d\u044c\u0448\u0438\u043c \u043f\u0440\u0438\u043e\u0440\u0438\u0442\u0435\u0442\u043e\u043c.<\/p>\n<\/li>\n<\/ul>\n<p>\u042d\u0442\u043e \u0431\u044b\u0432\u0430\u0435\u0442 \u043f\u043e\u043b\u0435\u0437\u043d\u043e, \u043a\u043e\u0433\u0434\u0430 \u0443 \u043d\u0430\u0441, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u0432 \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441\u0435 \u0435\u0441\u0442\u044c \u043f\u043e\u043b\u0435 \u0432\u0432\u043e\u0434\u0430 \u0438 \u043e\u0433\u0440\u043e\u043c\u043d\u044b\u0439 \u0441\u043f\u0438\u0441\u043e\u043a\/\u0442\u0430\u0431\u043b\u0438\u0446\u0430, \u0437\u0430\u0432\u0438\u0441\u044f\u0449\u0430\u044f \u043e\u0442 \u044d\u0442\u043e\u0433\u043e \u0432\u0432\u043e\u0434\u0430. \u041c\u044b \u0445\u043e\u0442\u0438\u043c, \u0447\u0442\u043e\u0431\u044b \u0438\u043d\u043f\u0443\u0442 \u043d\u0435 \u0442\u043e\u0440\u043c\u043e\u0437\u0438\u043b, \u0430 \u043e\u0431\u043d\u043e\u0432\u043b\u0435\u043d\u0438\u0435 \u0441\u043f\u0438\u0441\u043a\u0430 \u043f\u0440\u043e\u0438\u0441\u0445\u043e\u0434\u0438\u043b\u043e \u043b\u0435\u043d\u0438\u0432\u043e (deferred).<\/p>\n<h4>\u041f\u0440\u0438\u043c\u0435\u0440 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f<\/h4>\n<p>\u0417\u0434\u0435\u0441\u044c \u043f\u0440\u0438 \u0432\u0432\u043e\u0434\u0435 \u0442\u0435\u043a\u0441\u0442\u0430 \u043f\u043e\u043b\u0435 \u043e\u0431\u043d\u043e\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0441\u0440\u0430\u0437\u0443, \u043d\u043e \u0434\u043b\u044f \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u0430 <code>SearchResults<\/code> \u043f\u0435\u0440\u0435\u0434\u0430\u0435\u0442\u0441\u044f \u043e\u0442\u043b\u043e\u0436\u0435\u043d\u043d\u043e\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e <code>useDeferredValue<\/code>. \u042d\u0442\u043e \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 React \u043e\u0431\u043d\u043e\u0432\u043b\u044f\u0442\u044c \u0441\u043f\u0438\u0441\u043e\u043a \u0441 \u043c\u0435\u043d\u044c\u0448\u0438\u043c \u043f\u0440\u0438\u043e\u0440\u0438\u0442\u0435\u0442\u043e\u043c, \u043f\u0440\u0435\u0434\u043e\u0442\u0432\u0440\u0430\u0449\u0430\u044f \u043b\u0438\u0448\u043d\u0438\u0435 \u0440\u0435\u043d\u0434\u0435\u0440\u044b \u043f\u0440\u0438 \u043a\u0430\u0436\u0434\u043e\u043c \u0432\u0432\u043e\u0434\u0435 \u0438 \u0443\u043b\u0443\u0447\u0448\u0430\u044f \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u044c, \u043e\u0441\u043e\u0431\u0435\u043d\u043d\u043e \u043f\u0440\u0438 \u0440\u0430\u0431\u043e\u0442\u0435 \u0441 \u0431\u043e\u043b\u044c\u0448\u0438\u043c\u0438 \u0434\u0430\u043d\u043d\u044b\u043c\u0438.  <\/p>\n<pre><code class=\"javascript\">import React, { useState, useDeferredValue, memo } from 'react';  const SearchResults = memo(function SearchResults({ searchTerm }) {   \/\/ \u0414\u043e\u043f\u0443\u0441\u0442\u0438\u043c, searchTerm - \u044d\u0442\u043e \u0443\u0436\u0435 \u043e\u0442\u043b\u043e\u0436\u0435\u043d\u043d\u043e\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435   const allItems = Array.from({ length: 5000 }, (_, i) =&gt; `Item ${i}`);    \/\/ \u041c\u043e\u0434\u0435\u043b\u0438\u0440\u0443\u0435\u043c \u043a\u0430\u043a\u0443\u044e-\u0442\u043e \u0442\u044f\u0436\u0451\u043b\u0443\u044e \u0444\u0438\u043b\u044c\u0442\u0440\u0430\u0446\u0438\u044e   const filteredItems = allItems.filter((item) =&gt;     item.toLowerCase().includes(searchTerm.toLowerCase())   );    return (     &lt;ul&gt;       {filteredItems.map((item, idx) =&gt; (         &lt;li key={idx}&gt;{item}&lt;\/li&gt;       ))}     &lt;\/ul&gt;   ); });  export default function App() {   const [inputValue, setInputValue] = useState('');   \/\/ \"\u041e\u0442\u043b\u043e\u0436\u0435\u043d\u043d\u043e\u0435\" \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u043d\u0430 \u043e\u0441\u043d\u043e\u0432\u0435 \u0442\u0435\u043a\u0443\u0449\u0435\u0433\u043e inputValue   const deferredValue = useDeferredValue(inputValue);    const handleChange = (e) =&gt; {     setInputValue(e.target.value);   };    return (     &lt;div&gt;       &lt;input value={inputValue} onChange={handleChange} placeholder=\"\u041f\u043e\u0438\u0441\u043a...\" \/&gt;       {\/*          \u0412 \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442 SearchResults \u043f\u0435\u0440\u0435\u0434\u0430\u0435\u043c \u041d\u0415 inputValue \u043d\u0430\u043f\u0440\u044f\u043c\u0443\u044e,         \u0430 \u0438\u043c\u0435\u043d\u043d\u043e deferredValue, \u0447\u0442\u043e\u0431\u044b \u043e\u043d \u043c\u043e\u0433 \u043e\u0431\u043d\u043e\u0432\u0438\u0442\u044c\u0441\u044f \u0441 \u043c\u0435\u043d\u044c\u0448\u0438\u043c \u043f\u0440\u0438\u043e\u0440\u0438\u0442\u0435\u0442\u043e\u043c        *\/}       &lt;SearchResults searchTerm={deferredValue} \/&gt;     &lt;\/div&gt;   ); }<\/code><\/pre>\n<h4>\u041a\u0430\u043a \u044d\u0442\u043e \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442?<\/h4>\n<ul>\n<li>\n<p><code>inputValue<\/code> \u043c\u0435\u043d\u044f\u0435\u0442\u0441\u044f \u043c\u0433\u043d\u043e\u0432\u0435\u043d\u043d\u043e, \u0438 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c \u0441\u0440\u0430\u0437\u0443 \u0432\u0438\u0434\u0438\u0442, \u0447\u0442\u043e \u043f\u043e\u043b\u0435 \u0432\u0432\u043e\u0434\u0430 \u043e\u0442\u0440\u0430\u0436\u0430\u0435\u0442 \u0435\u0433\u043e \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u044f (\u0431\u0435\u0437 \u0437\u0430\u0434\u0435\u0440\u0436\u043a\u0438).<\/p>\n<\/li>\n<li>\n<p>\u041d\u043e <code>SearchResults<\/code> \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u0442 \u043d\u0435 <code>inputValue<\/code>, \u0430 <code>deferredValue<\/code>. \u042d\u0442\u043e \u0437\u043d\u0430\u0447\u0438\u0442, \u0447\u0442\u043e React \u043c\u043e\u0436\u0435\u0442 \u043f\u043e\u0434\u043e\u0436\u0434\u0430\u0442\u044c \u043f\u043e\u0434\u0445\u043e\u0434\u044f\u0449\u0438\u0439 \u043c\u043e\u043c\u0435\u043d\u0442 \u0434\u043b\u044f \u0440\u0435\u043d\u0434\u0435\u0440\u0430.<\/p>\n<\/li>\n<li>\n<p>\u0422\u0430\u043a \u043c\u044b \u0438\u0437\u0431\u0435\u0433\u0430\u0435\u043c \u043c\u043e\u043c\u0435\u043d\u0442\u0430\u043b\u044c\u043d\u044b\u0445 \u0440\u0435\u0440\u0435\u043d\u0434\u0435\u0440\u043e\u0432 \u0442\u044f\u0436\u0451\u043b\u044b\u0445 \u0441\u043f\u0438\u0441\u043a\u043e\u0432 \u043f\u0440\u0438 \u043a\u0430\u0436\u0434\u043e\u043c \u043d\u0430\u0431\u0440\u0430\u043d\u043d\u043e\u043c \u0441\u0438\u043c\u0432\u043e\u043b\u0435.<\/p>\n<\/li>\n<\/ul>\n<h4>\u041e\u0442\u043b\u0438\u0447\u0438\u0435 \u043e\u0442 useTransition<\/h4>\n<ul>\n<li>\n<p><code>useTransition<\/code>: \u043c\u044b \u044f\u0432\u043d\u043e \u043e\u0431\u043e\u0440\u0430\u0447\u0438\u0432\u0430\u0435\u043c \u043a\u0430\u043a\u0443\u044e-\u0442\u043e \u043b\u043e\u0433\u0438\u043a\u0443 (\u043e\u0431\u043d\u043e\u0432\u043b\u0435\u043d\u0438\u0435 \u0441\u0442\u0435\u0439\u0442\u0430) \u0432 <code>startTransition<\/code>.<\/p>\n<\/li>\n<li>\n<p><code>useDeferredValue<\/code>: \u043c\u044b \u0438\u043c\u0435\u0435\u043c \u0434\u0432\u0430 \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u044f &#8212; \u043e\u0441\u043d\u043e\u0432\u043d\u043e\u0435 \u0438 \u043e\u0442\u043b\u043e\u0436\u0435\u043d\u043d\u043e\u0435. \u041f\u0440\u043e\u0441\u0442\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c <code>deferredValue<\/code> \u0442\u0430\u043c, \u0433\u0434\u0435 \u0440\u0435\u043d\u0434\u0435\u0440\u044b \u043c\u043e\u0433\u0443\u0442 \u0431\u044b\u0442\u044c \u043e\u0442\u043b\u043e\u0436\u0435\u043d\u044b.<\/p>\n<\/li>\n<\/ul>\n<p>\u0418\u043d\u043e\u0433\u0434\u0430 \u044d\u0442\u0438 \u0445\u0443\u043a\u0438 \u043c\u043e\u0436\u043d\u043e \u043a\u043e\u043c\u0431\u0438\u043d\u0438\u0440\u043e\u0432\u0430\u0442\u044c &#8212; \u0432\u0441\u0451 \u0437\u0430\u0432\u0438\u0441\u0438\u0442 \u043e\u0442 \u043a\u043e\u043d\u043a\u0440\u0435\u0442\u043d\u043e\u0439 \u0437\u0430\u0434\u0430\u0447\u0438.<\/p>\n<h4>\u0417\u0430\u0447\u0435\u043c \u043d\u0443\u0436\u0435\u043d useDeferredValue, \u0435\u0441\u043b\u0438 \u0435\u0441\u0442\u044c useDebounce?<\/h4>\n<p>\u041e\u0431\u0430 \u0445\u0443\u043a\u0430 \u0440\u0435\u0448\u0430\u044e\u0442 \u0437\u0430\u0434\u0430\u0447\u0438, \u0441\u0432\u044f\u0437\u0430\u043d\u043d\u044b\u0435 \u0441 \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u044c\u044e, \u043d\u043e \u0434\u0435\u043b\u0430\u044e\u0442 \u044d\u0442\u043e \u0440\u0430\u0437\u043d\u044b\u043c\u0438 \u0441\u043f\u043e\u0441\u043e\u0431\u0430\u043c\u0438. <a href=\"https:\/\/www.npmjs.com\/package\/use-debounce\" rel=\"noopener noreferrer nofollow\">useDebounce<\/a> \u043f\u043e\u043b\u0435\u0437\u0435\u043d \u0434\u043b\u044f \u0437\u0430\u0434\u0435\u0440\u0436\u043a\u0438 \u0432\u044b\u0437\u043e\u0432\u043e\u0432 \u0444\u0443\u043d\u043a\u0446\u0438\u0439 \u043d\u0430 \u043e\u0441\u043d\u043e\u0432\u0435 \u0432\u0440\u0435\u043c\u0435\u043d\u0438, \u0447\u0442\u043e\u0431\u044b \u043f\u0440\u0435\u0434\u043e\u0442\u0432\u0440\u0430\u0442\u0438\u0442\u044c \u0447\u0430\u0441\u0442\u044b\u0435 \u043e\u0431\u043d\u043e\u0432\u043b\u0435\u043d\u0438\u044f \u0434\u0430\u043d\u043d\u044b\u0445, \u0442\u043e\u0433\u0434\u0430 \u043a\u0430\u043a <code>useDeferredValue<\/code> \u043f\u0440\u0435\u0434\u043d\u0430\u0437\u043d\u0430\u0447\u0435\u043d \u0434\u043b\u044f \u0443\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u044f \u043f\u0440\u0438\u043e\u0440\u0438\u0442\u0435\u0442\u043e\u043c \u043e\u0431\u043d\u043e\u0432\u043b\u0435\u043d\u0438\u0439 \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441\u0430. \u0415\u0441\u043b\u0438 \u0437\u0430\u0434\u0430\u0447\u0430 \u0437\u0430\u043a\u043b\u044e\u0447\u0430\u0435\u0442\u0441\u044f \u0432 \u0442\u043e\u043c, \u0447\u0442\u043e\u0431\u044b \u043d\u0435 \u0431\u043b\u043e\u043a\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441 \u043f\u0440\u0438 \u0440\u0435\u043d\u0434\u0435\u0440\u0438\u043d\u0433\u0435 \u0431\u043e\u043b\u044c\u0448\u043e\u0433\u043e \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u0430 \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u043e\u0432, \u043d\u043e \u043f\u0440\u0438 \u044d\u0442\u043e\u043c \u043d\u0435 \u0437\u0430\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u0442\u044c \u043e\u0431\u043d\u043e\u0432\u043b\u0435\u043d\u0438\u0435 \u0441\u0430\u043c\u043e\u0433\u043e \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f (\u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u0432 \u043f\u043e\u043b\u0435 \u0432\u0432\u043e\u0434\u0430), \u0442\u043e <code>useDeferredValue<\/code> &#8212; \u043b\u0443\u0447\u0448\u0438\u0439 \u0432\u044b\u0431\u043e\u0440.<\/p>\n<p>\u0412 \u0442\u043e \u0432\u0440\u0435\u043c\u044f \u043a\u0430\u043a <code>useDebounce<\/code> \u043c\u043e\u0436\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0434\u043b\u044f \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0438 \u0430\u0441\u0438\u043d\u0445\u0440\u043e\u043d\u043d\u044b\u0445 \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u0439 (\u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u0434\u043b\u044f \u0443\u043c\u0435\u043d\u044c\u0448\u0435\u043d\u0438\u044f \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u0430 \u0437\u0430\u043f\u0440\u043e\u0441\u043e\u0432), <code>useDeferredValue<\/code> \u043b\u0443\u0447\u0448\u0435 \u043f\u043e\u0434\u0445\u043e\u0434\u0438\u0442 \u0434\u043b\u044f \u0443\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u044f \u0440\u0435\u043d\u0434\u0435\u0440\u043e\u043c \u0438 \u0430\u0441\u0438\u043d\u0445\u0440\u043e\u043d\u043d\u044b\u043c\u0438 \u043e\u0431\u043d\u043e\u0432\u043b\u0435\u043d\u0438\u044f\u043c\u0438 \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.<\/p>\n<h3>useOptimistic: \u043e\u043f\u0442\u0438\u043c\u0438\u0441\u0442\u0438\u0447\u043d\u044b\u0435 \u043e\u0431\u043d\u043e\u0432\u043b\u0435\u043d\u0438\u044f \u0431\u0435\u0437 \u0431\u043e\u043b\u0438 <\/h3>\n<h4>\u0427\u0442\u043e \u0442\u0430\u043a\u043e\u0435 \u043e\u043f\u0442\u0438\u043c\u0438\u0441\u0442\u0438\u0447\u043d\u044b\u0435 \u043e\u0431\u043d\u043e\u0432\u043b\u0435\u043d\u0438\u044f?<\/h4>\n<p>\u0414\u043e\u043f\u0443\u0441\u0442\u0438\u043c, \u0443 \u043d\u0430\u0441 \u0435\u0441\u0442\u044c \u0444\u043e\u0440\u043c\u0430, \u0433\u0434\u0435 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c \u043c\u043e\u0436\u0435\u0442 \u043e\u0442\u043f\u0440\u0430\u0432\u0438\u0442\u044c \u043a\u043e\u043c\u043c\u0435\u043d\u0442\u0430\u0440\u0438\u0439 \u0438\u043b\u0438 \u043f\u043e\u0441\u0442. \u0412 \u043a\u043b\u0430\u0441\u0441\u0438\u0447\u0435\u0441\u043a\u043e\u043c \u0441\u0446\u0435\u043d\u0430\u0440\u0438\u0438 \u043c\u044b:<\/p>\n<ol>\n<li>\n<p>\u041e\u0442\u043f\u0440\u0430\u0432\u043b\u044f\u0435\u043c \u0437\u0430\u043f\u0440\u043e\u0441 \u043d\u0430 \u0441\u0435\u0440\u0432\u0435\u0440.<\/p>\n<\/li>\n<li>\n<p>\u0416\u0434\u0451\u043c \u043e\u0442\u0432\u0435\u0442\u0430 (200 OK).<\/p>\n<\/li>\n<li>\n<p>\u0422\u043e\u043b\u044c\u043a\u043e \u0442\u043e\u0433\u0434\u0430 \u043e\u0431\u043d\u043e\u0432\u043b\u044f\u0435\u043c UI, \u043f\u043e\u043a\u0430\u0437\u044b\u0432\u0430\u044f \u043d\u043e\u0432\u044b\u0439 \u043a\u043e\u043c\u043c\u0435\u043d\u0442\u0430\u0440\u0438\u0439 \u0432 \u0441\u043f\u0438\u0441\u043a\u0435.<\/p>\n<\/li>\n<\/ol>\n<p>\u041d\u043e \u0435\u0441\u043b\u0438 \u0437\u0430\u0434\u0435\u0440\u0436\u043a\u0430 \u0431\u043e\u043b\u044c\u0448\u0430\u044f, \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c \u0432\u0438\u0434\u0438\u0442 \u0437\u0430\u0432\u0438\u0441\u0430\u043d\u0438\u0435: \u0444\u043e\u0440\u043c\u0430 \u043d\u0435 \u043e\u0431\u043d\u043e\u0432\u043b\u044f\u0435\u0442\u0441\u044f, \u0445\u043e\u0442\u044f \u043e\u043d \u0443\u0436\u0435 \u043d\u0430\u0436\u0430\u043b \u041e\u0442\u043f\u0440\u0430\u0432\u0438\u0442\u044c. \u0427\u0442\u043e\u0431\u044b \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441 \u043a\u0430\u0437\u0430\u043b\u0441\u044f \u0448\u0443\u0441\u0442\u0440\u0435\u0435, \u043c\u044b \u0434\u0435\u043b\u0430\u0435\u043c \u043e\u043f\u0442\u0438\u043c\u0438\u0441\u0442\u0438\u0447\u043d\u043e\u0435 \u043e\u0431\u043d\u043e\u0432\u043b\u0435\u043d\u0438\u0435 &#8212; \u0441\u0440\u0430\u0437\u0443 \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u043c \u043a\u043e\u043c\u043c\u0435\u043d\u0442\u0430\u0440\u0438\u0439 \u0432 \u0441\u043f\u0438\u0441\u043e\u043a \u043a\u0430\u043a \u0431\u0443\u0434\u0442\u043e \u0437\u0430\u043f\u0440\u043e\u0441 \u0441\u0440\u0430\u0431\u043e\u0442\u0430\u043b, \u0430 \u0435\u0441\u043b\u0438 \u0447\u0442\u043e-\u0442\u043e \u043f\u043e\u0448\u043b\u043e \u043d\u0435 \u0442\u0430\u043a (\u0441\u0435\u0440\u0432\u0435\u0440 \u0432\u0435\u0440\u043d\u0443\u043b \u043e\u0448\u0438\u0431\u043a\u0443), \u0442\u043e \u043e\u0442\u043a\u0430\u0442\u044b\u0432\u0430\u0435\u043c.<\/p>\n<p>\u0420\u0430\u043d\u0435\u0435 \u044d\u0442\u043e \u043f\u0440\u0438\u0445\u043e\u0434\u0438\u043b\u043e\u0441\u044c \u0432\u0440\u0443\u0447\u043d\u0443\u044e \u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u044b\u0432\u0430\u0442\u044c: \u0445\u0440\u0430\u043d\u0438\u0442\u044c \u0432\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0435 \u0430\u0439\u0434\u0438\u0448\u043d\u0438\u043a\u0438, \u043e\u0442\u043c\u0435\u043d\u044f\u0442\u044c \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u044f \u0432 \u0441\u043b\u0443\u0447\u0430\u0435 \u043e\u0448\u0438\u0431\u043a\u0438 \u0438 \u0442. \u0434. \u041d\u043e \u0432 <strong>React 19<\/strong> \u0435\u0441\u0442\u044c \u0445\u0443\u043a <code>useOptimistic<\/code>, \u043f\u0440\u0438\u0437\u0432\u0430\u043d\u043d\u044b\u0439 \u0443\u043f\u0440\u043e\u0441\u0442\u0438\u0442\u044c \u0432\u0441\u044e \u044d\u0442\u0443 \u0441\u0445\u0435\u043c\u0443.<\/p>\n<h4>\u041a\u0430\u043a \u044d\u0442\u043e \u0432\u044b\u0433\u043b\u044f\u0434\u0438\u0442 \u0432 \u043a\u043e\u0434\u0435?<\/h4>\n<p>\u0412 \u044d\u0442\u043e\u043c \u043f\u0440\u0438\u043c\u0435\u0440\u0435 \u043f\u0440\u0438 \u043e\u0442\u043f\u0440\u0430\u0432\u043a\u0435 \u043d\u043e\u0432\u043e\u0433\u043e \u043a\u043e\u043c\u043c\u0435\u043d\u0442\u0430\u0440\u0438\u044f \u043e\u043d \u0441\u0440\u0430\u0437\u0443 \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0432 \u0441\u043f\u0438\u0441\u043e\u043a, \u0441\u043e\u0437\u0434\u0430\u0432\u0430\u044f \u0432\u0438\u0434\u0438\u043c\u043e\u0441\u0442\u044c \u0443\u0441\u043f\u0435\u0448\u043d\u043e\u0439 \u043e\u0442\u043f\u0440\u0430\u0432\u043a\u0438. \u0415\u0441\u043b\u0438 \u0437\u0430\u043f\u0440\u043e\u0441 \u043d\u0430 \u0441\u0435\u0440\u0432\u0435\u0440 \u043d\u0435 \u0443\u0434\u0430\u0451\u0442\u0441\u044f, \u0432\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0439 \u043a\u043e\u043c\u043c\u0435\u043d\u0442\u0430\u0440\u0438\u0439 \u0443\u0434\u0430\u043b\u044f\u0435\u0442\u0441\u044f, \u0438 \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441 \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u0442\u0441\u044f \u043a \u0438\u0441\u0445\u043e\u0434\u043d\u043e\u043c\u0443 \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u044e. \u042d\u0442\u043e \u0434\u0435\u043b\u0430\u0435\u0442 \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441 \u0431\u043e\u043b\u0435\u0435 \u043e\u0442\u0437\u044b\u0432\u0447\u0438\u0432\u044b\u043c, \u043f\u043e\u0441\u043a\u043e\u043b\u044c\u043a\u0443 \u043d\u0435 \u043d\u0443\u0436\u043d\u043e \u0436\u0434\u0430\u0442\u044c \u043e\u0442\u0432\u0435\u0442\u0430 \u043e\u0442 \u0441\u0435\u0440\u0432\u0435\u0440\u0430 \u0434\u043b\u044f \u043e\u0431\u043d\u043e\u0432\u043b\u0435\u043d\u0438\u044f UI.<\/p>\n<pre><code class=\"javascript\">import { useOptimistic, useState, useRef } from \"react\";  async function makeOrder(orderName) {   \/\/ \u043c\u043e\u043a \u0437\u0430\u043f\u0440\u043e\u0441\u0430 \u043d\u0430 \u0441\u0435\u0440\u0432\u0435\u0440   await new Promise((res) =&gt; setTimeout(res, 1500));   return orderName; }  function Kitchen({ orders, onMakeOrder }) {   const formRef = useRef();    async function formAction(formData) {     const orderName = formData.get(\"orderName\");     addOptimisticOrder(orderName);     formRef.current.reset();     await onMakeOrder(orderName);   }    const [optimisticOrders, addOptimisticOrder] = useOptimistic(     orders,     (state, newOrder) =&gt; [...state, { orderName: newOrder, preparing: true }]   );    return (     &lt;div&gt;       &lt;form action={formAction} ref={formRef}&gt;         &lt;input type=\"text\" name=\"orderName\" placeholder=\"\u0412\u0432\u0435\u0434\u0438\u0442\u0435 \u0437\u0430\u043a\u0430\u0437!\" \/&gt;         &lt;button type=\"submit\"&gt;\u0417\u0430\u043a\u0430\u0437\u0430\u0442\u044c&lt;\/button&gt;       &lt;\/form&gt;        {optimisticOrders.map((order, index) =&gt; (         &lt;div<\/code><\/pre>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\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-443808","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/443808","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=443808"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/443808\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=443808"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=443808"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=443808"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}