{"id":356635,"date":"2024-05-20T23:33:56","date_gmt":"2024-05-20T23:33:56","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=356635"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=356635","title":{"rendered":"<span>\u0427\u0442\u043e \u0431\u044b\u0441\u0442\u0440\u0435\u0435: Animated + useNativeDriver \u0438\u043b\u0438 Reanimated?<\/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\/3d7\/622\/529\/3d76225299eb04ebc8ab5657e15ab840.jpg\" width=\"1920\" height=\"1080\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/3d7\/622\/529\/3d76225299eb04ebc8ab5657e15ab840.jpg\" data-blurred=\"true\"\/><\/figure>\n<p>\u041f\u0440\u0438\u0432\u0435\u0442! \u041c\u0435\u043d\u044f \u0437\u043e\u0432\u0443\u0442 \u0414\u0435\u043d\u0438\u0441, \u044f \u043c\u043e\u0431\u0438\u043b\u044c\u043d\u044b\u0439 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a \u0432 \u0421\u0431\u0435\u0440\u041c\u0430\u0440\u043a\u0435\u0442\u0435. \u041f\u0438\u0448\u0443 \u043d\u0430 React Native \u0438 \u043b\u044e\u0431\u043b\u044e \u0430\u043d\u0438\u043c\u0430\u0446\u0438\u0438, \u0432\u0435\u0434\u044c \u043e\u043d\u0438 \u0434\u0430\u044e\u0442 \u0436\u0438\u0437\u043d\u044c \u043d\u0430\u0448\u0438\u043c \u043f\u0440\u043e\u0435\u043a\u0442\u0430\u043c \ud83d\ude42<\/p>\n<p>\u0412 \u044d\u0442\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0435 \u043f\u043e\u043f\u0440\u043e\u0431\u0443\u0435\u043c \u0440\u0430\u0437\u043e\u0431\u0440\u0430\u0442\u044c\u0441\u044f, \u0447\u0442\u043e \u0436\u0435 \u0432\u0441\u0451-\u0442\u0430\u043a\u0438 \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u0431\u044b\u0441\u0442\u0440\u0435\u0435: <strong>React-Native-Reanimated<\/strong> \u0438\u043b\u0438 <strong>Animated + useNativeDriver: true<\/strong>.<\/p>\n<p>\u0411\u0443\u0434\u0435\u043c \u0441\u0440\u0430\u0432\u043d\u0438\u0432\u0430\u0442\u044c FPS, \u043d\u0430\u0433\u0440\u0443\u0437\u043a\u0443 \u043d\u0430 \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u043e\u0440, \u043e\u043f\u0435\u0440\u0430\u0442\u0438\u0432\u043d\u0443\u044e \u043f\u0430\u043c\u044f\u0442\u044c \u0438 \u0432\u043e\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f EventQueue \u0434\u043b\u044f \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u0438\u044f \u043b\u043e\u0433\u043e\u0432.<\/p>\n<p><strong><em>\u0414\u0438\u0441\u043a\u043b\u0435\u0439\u043c\u0435\u0440: <\/em><\/strong><em>\u042d\u0442\u043e \u0442\u0435\u043e\u0440\u0435\u0442\u0438\u0447\u0435\u0441\u043a\u043e\u0435 \u0441\u0440\u0430\u0432\u043d\u0435\u043d\u0438\u0435 \u043d\u0430 \u0430\u0431\u0441\u0442\u0440\u0430\u043a\u0442\u043d\u044b\u0445 \u043f\u0440\u0438\u043c\u0435\u0440\u0430\u0445, \u0442\u0430\u043a \u0447\u0442\u043e \u043f\u0435\u0440\u0444\u043e\u043c\u0430\u043d\u0441 \u043d\u0430 \u0440\u0435\u0430\u043b\u044c\u043d\u044b\u0445 \u043f\u0440\u043e\u0435\u043a\u0442\u0430\u0445 \u043c\u043e\u0436\u0435\u0442 \u043e\u0442\u043b\u0438\u0447\u0430\u0442\u044c\u0441\u044f. \u041d\u043e \u044f \u043f\u043e\u0441\u0442\u0430\u0440\u0430\u043b\u0441\u044f \u043d\u0430\u0433\u0440\u0443\u0437\u0438\u0442\u044c \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442\u044b \u043a\u0430\u043a \u0441\u043b\u0435\u0434\u0443\u0435\u0442 \u0438 \u0445\u043e\u0440\u043e\u0448\u0435\u043d\u044c\u043a\u043e \u043f\u0440\u043e\u0432\u0435\u0440\u0438\u0442\u044c \u0438\u0445 \u043d\u0430 \u043f\u0440\u043e\u0447\u043d\u043e\u0441\u0442\u044c. <\/em><\/p>\n<p><a href=\"#why\">\u041f\u043e\u0447\u0435\u043c\u0443 \u0438\u043c\u0435\u043d\u043d\u043e \u044d\u0442\u043e\u0442 \u044d\u043a\u0441\u043f\u0435\u0440\u0438\u043c\u0435\u043d\u0442?<\/a><\/p>\n<p><a href=\"#11\">\u042d\u043a\u0441\u043f\u0435\u0440\u0438\u043c\u0435\u043d\u0442 1. \u0422\u0435\u0441\u0442\u0438\u0440\u0443\u0435\u043c loop \u0430\u043d\u0438\u043c\u0430\u0446\u0438\u044e <\/a><\/p>\n<p><a href=\"#12\">\u042d\u043a\u0441\u043f\u0435\u0440\u0438\u043c\u0435\u043d\u0442 2. \u0414\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u043c scale<\/a><\/p>\n<p><a href=\"#2\">\u042d\u043a\u0441\u043f\u0435\u0440\u0438\u043c\u0435\u043d\u0442 3. \u0410\u043d\u0438\u043c\u0430\u0446\u0438\u044f, \u043f\u0440\u0438\u0432\u044f\u0437\u0430\u043d\u043d\u0430\u044f \u043a \u0441\u043a\u0440\u043e\u043b\u043b\u0443<\/a><\/p>\n<p><a href=\"#fin\">\u0422\u0430\u043a \u043a\u0442\u043e \u0431\u044b\u0441\u0442\u0440\u0435\u0435?<\/a><\/p>\n<p><a class=\"anchor\" name=\"why\" id=\"why\"><\/a><\/p>\n<h2>\u041f\u043e\u0447\u0435\u043c\u0443 \u0438\u043c\u0435\u043d\u043d\u043e \u044d\u0442\u043e\u0442 \u044d\u043a\u0441\u043f\u0435\u0440\u0438\u043c\u0435\u043d\u0442?<\/h2>\n<p>\u041d\u0435 \u0442\u0430\u043a \u0434\u0430\u0432\u043d\u043e \u043c\u043e\u0439 \u043a\u043e\u043b\u043b\u0435\u0433\u0430 \u0416\u0435\u043d\u044f \u041f\u0440\u043e\u043a\u043e\u043f\u044c\u0435\u0432 (aka <a href=\"https:\/\/habr.com\/ru\/users\/Evgen175\/\"><u>@Evgen175<\/u><\/a>) \u043e\u043f\u0443\u0431\u043b\u0438\u043a\u043e\u0432\u0430\u043b \u043d\u0430 \u0425\u0430\u0431\u0440\u0435 \u0441\u0442\u0430\u0442\u044c\u044e \u0432 \u0434\u0432\u0443\u0445 \u0447\u0430\u0441\u0442\u044f\u0445 \u043e \u0442\u043e\u043c, \u043f\u043e\u0447\u0435\u043c\u0443 \u0430\u043d\u0438\u043c\u0430\u0446\u0438\u0438 \u0432 React Native \u0440\u0430\u0431\u043e\u0442\u0430\u044e\u0442 \u0438\u043c\u0435\u043d\u043d\u043e \u0442\u0430\u043a, \u043a\u0430\u043a \u0440\u0430\u0431\u043e\u0442\u0430\u044e\u0442. \u0426\u0435\u043b\u044c \u0441\u0435\u0440\u0438\u0438 \u2014\u00a0<strong>\u043e\u0431\u044a\u044f\u0441\u043d\u0438\u0442\u044c, \u043e\u0442\u043a\u0443\u0434\u0430 \u0431\u0435\u0440\u0443\u0442\u0441\u044f \u043b\u0430\u0433\u0438 \u0432 \u0430\u043d\u0438\u043c\u0430\u0446\u0438\u044f\u0445, \u0437\u0430 \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043c\u043d\u043e\u0433\u0438\u0435 \u0442\u0430\u043a \u043d\u0435 \u043b\u044e\u0431\u044f\u0442 RN<\/strong>, \u0438 \u0434\u0430\u0442\u044c \u0441\u043e\u0432\u0435\u0442\u044b, \u0434\u043b\u044f \u043a\u0430\u043a\u0438\u0445 \u0441\u043b\u0443\u0447\u0430\u0435\u0432 \u043b\u0443\u0447\u0448\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0440\u0430\u0437\u043d\u044b\u0435 \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442\u044b.<\/p>\n<ul>\n<li>\n<p><a href=\"https:\/\/habr.com\/ru\/companies\/sbermarket\/articles\/748724\/\">\u041f\u043e\u0434 \u043a\u0430\u043f\u043e\u0442\u043e\u043c \u0430\u043d\u0438\u043c\u0430\u0446\u0438\u0439 \u0432 React Native. \u0427\u0430\u0441\u0442\u044c 1\/2: Animated and Bridge<\/a><\/p>\n<\/li>\n<li>\n<p><a href=\"https:\/\/habr.com\/ru\/companies\/sbermarket\/articles\/750000\/\">\u041f\u043e\u0434 \u043a\u0430\u043f\u043e\u0442\u043e\u043c \u0430\u043d\u0438\u043c\u0430\u0446\u0438\u0439 \u0432 React Native. \u0427\u0430\u0441\u0442\u044c 2\/2: Reanimated and JSI<\/a><\/p>\n<\/li>\n<\/ul>\n<p>\u0412 \u0444\u0438\u043d\u0430\u043b\u0435 \u043f\u043e\u043b\u0443\u0447\u0438\u043b\u0438\u0441\u044c \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0435 \u0432\u044b\u0432\u043e\u0434\u044b:<\/p>\n<div>\n<div class=\"table\">\n<table>\n<tbody>\n<tr>\n<td colspan=\"2\">\n<p align=\"center\">\u041a\u0430\u043a\u043e\u0439 \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442 \u0432\u044b\u0431\u0440\u0430\u0442\u044c?<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p align=\"center\"><strong>Animated<\/strong><\/p>\n<\/td>\n<td>\n<p align=\"center\"><strong>Reanimated<\/strong><\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p>\u0414\u043b\u044f \u043f\u0440\u043e\u0441\u0442\u044b\u0445 \u0430\u043d\u0438\u043c\u0430\u0446\u0438\u0439<\/p>\n<p>\u041a\u043e\u0433\u0434\u0430 \u043d\u0430\u0434\u043e \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u0430\u043d\u0438\u043c\u0430\u0446\u0438\u044e, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u043d\u0435 \u043f\u0435\u0440\u0435\u0440\u0438\u0441\u043e\u0432\u044b\u0432\u0430\u0435\u0442 \u043c\u0430\u043a\u0435\u0442: transform, opacity, borderRadius \u0438 \u0434\u0440.<\/p>\n<p>(!) \u0412\u0441\u0435\u0433\u0434\u0430 \u043d\u0430\u0434\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c useNativeDriver: true<\/p>\n<\/td>\n<td>\n<p>\u0415\u0441\u043b\u0438 \u0441\u0432\u043e\u0439\u0441\u0442\u0432\u0430, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043d\u0430\u0434\u043e \u0430\u043d\u0438\u043c\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u043f\u0435\u0440\u0435\u0440\u0438\u0441\u043e\u0432\u044b\u0432\u0430\u044e\u0442 \u043c\u0430\u043a\u0435\u0442<\/p>\n<p>\u0415\u0441\u043b\u0438 \u043d\u0430\u0434\u043e \u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u0442\u044c \u0441\u043b\u043e\u0436\u043d\u0443\u044e \u0430\u043d\u0438\u043c\u0430\u0446\u0438\u044e, \u0433\u0434\u0435 \u0440\u0430\u0437\u043d\u044b\u0435 \u0441\u0432\u043e\u0439\u0441\u0442\u0432\u0430 \u0437\u0430\u0432\u0438\u0441\u044f\u0442 \u0434\u0440\u0443\u0433 \u043e\u0442 \u0434\u0440\u0443\u0433\u0430<\/p>\n<p>\u041a\u043e\u0433\u0434\u0430 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c \u0436\u0435\u0441\u0442\u044b<\/p>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<\/div>\n<p>\u0410 \u0435\u0449\u0451 \u043f\u043e\u044f\u0432\u0438\u043b\u0430\u0441\u044c \u0433\u0438\u043f\u043e\u0442\u0435\u0437\u0430:<\/p>\n<blockquote>\n<p>Animated \u0441 useNativeDriver \u043e\u0442\u043f\u0440\u0430\u0432\u043b\u044f\u0435\u0442 \u0433\u0440\u0430\u0444, \u043e\u043f\u0438\u0441\u044b\u0432\u0430\u044e\u0449\u0438\u0439 \u0430\u043d\u0438\u043c\u0430\u0446\u0438\u044e, \u0434\u043b\u044f \u0440\u0430\u0441\u0447\u0435\u0442\u0430 \u043d\u0430 UI, \u0430 Reanimated \u0434\u0435\u043b\u0430\u0435\u0442 \u0432\u0441\u0435 \u0440\u0430\u0441\u0447\u0435\u0442\u044b \u043d\u0430 \u0441\u0442\u043e\u0440\u043e\u043d\u0435 JS. <\/p>\n<p>\u0412\u043e\u0437\u043c\u043e\u0436\u043d\u043e \u0438\u0437-\u0437\u0430 \u043c\u0435\u043d\u044c\u0448\u0435\u0433\u043e \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u0430 \u00ab\u043d\u0430\u043a\u043b\u0430\u0434\u043d\u044b\u0445 \u0440\u0430\u0441\u0445\u043e\u0434\u043e\u0432\u00bb <strong>Animated \u0431\u0443\u0434\u0435\u0442 \u0438\u043c\u0435\u0442\u044c \u043b\u0443\u0447\u0448\u0443\u044e \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u044c \u0438 \u0431\u0443\u0434\u0435\u0442 \u043c\u0435\u043d\u044c\u0448\u0435 \u043f\u043e\u0442\u0440\u0435\u0431\u043b\u044f\u0442\u044c \u043f\u0430\u043c\u044f\u0442\u044c<\/strong> \u0434\u043b\u044f \u0442\u0435\u0445 \u043a\u0435\u0439\u0441\u043e\u0432, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043c\u043e\u0436\u043d\u043e \u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u0442\u044c \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u043e\u0431\u043e\u0438\u0445 \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442\u043e\u0432.<\/p>\n<\/blockquote>\n<p>\u041d\u0443 \u0447\u0442\u043e \u0436, \u043f\u0435\u0440\u0435\u0445\u0432\u0430\u0442\u044b\u0432\u0430\u044e \u044d\u0441\u0442\u0430\u0444\u0435\u0442\u0443. \u0425\u043e\u0447\u0435\u0442\u0441\u044f \u0440\u0430\u0437 \u0438 \u043d\u0430\u0432\u0441\u0435\u0433\u0434\u0430 \u0432\u044b\u044f\u0441\u043d\u0438\u0442\u044c, \u0434\u043b\u044f \u043a\u0430\u043a\u0438\u0445 \u043a\u0435\u0439\u0441\u043e\u0432 \u0447\u0442\u043e \u043e\u043f\u0442\u0438\u043c\u0430\u043b\u044c\u043d\u0435\u0435.<\/p>\n<p>\u0412 \u043a\u0440\u0430\u0441\u043d\u043e\u043c \u0443\u0433\u043b\u0443 \u0440\u0438\u043d\u0433\u0430 \u2014\u00a0Animated. \u0412 \u0441\u0438\u043d\u0435\u043c \u2014\u00a0Reanimated. \u041f\u043e\u0435\u0445\u0430\u043b\u0438!<\/p>\n<p><a class=\"anchor\" name=\"11\" id=\"11\"><\/a><\/p>\n<h2>\u042d\u043a\u0441\u043f\u0435\u0440\u0438\u043c\u0435\u043d\u0442 1. \u0422\u0435\u0441\u0442\u0438\u0440\u0443\u0435\u043c loop \u0430\u043d\u0438\u043c\u0430\u0446\u0438\u044e <\/h2>\n<p>\u0412\u043e\u0437\u044c\u043c\u0435\u043c 500 \u0448\u0430\u0440\u0438\u043a\u043e\u0432 \u0441 \u0430\u043d\u0438\u043c\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u043c translateY, \u0447\u0442\u043e\u0431\u044b \u0431\u044b\u043b\u043e \u043d\u0430\u0433\u043b\u044f\u0434\u043d\u0435\u0435. \u0414\u043e\u0431\u0430\u0432\u0438\u043c loop \u0438 \u043d\u0430\u043a\u0438\u043d\u0435\u043c easing \u0444\u0443\u043d\u043a\u0446\u0438\u044e.<\/p>\n<details class=\"spoiler\">\n<summary>\u041a\u043e\u0434 Reanimated<\/summary>\n<div class=\"spoiler__content\">\n<pre><code class=\"javascript\">export const ReanimatedAnimatedItem = () => {   const animation = useDerivedValue(() =>     withRepeat(       withSequence(         withTiming(0, {           duration: twoNumRandom(1500, 2000),           easing: Easing.bounce,         }),         withTiming(1, {           duration: twoNumRandom(1500, 2000),           easing: Easing.bounce,         }),       ),       -1,       true,     ),   );    const animatedStyle = useAnimatedStyle(() => ({     transform: [       {         translateY: interpolate(           animation.value,           [0, 1],           [0, 834.3333129882812],         ),       },     ],   }));    return (     &lt;Animated.View       style={[styles.box, {left: generateRandom()}, animatedStyle]}     \/>   ); }; <\/code><\/pre>\n<\/p>\n<\/div>\n<\/details>\n<details class=\"spoiler\">\n<summary>\u041a\u043e\u0434 Animated<\/summary>\n<div class=\"spoiler__content\">\n<pre><code class=\"javascript\">export const NativeAnimatedItem = () => {   const value = useRef(new Animated.Value(0)).current;    useEffect(() => {     Animated.loop(       Animated.sequence([         Animated.timing(value, {           toValue: 834.3333129882812,           useNativeDriver: true,           duration: twoNumRandom(1500, 2000),           easing: Easing.bounce,         }),         Animated.timing(value, {           toValue: 0,           useNativeDriver: true,           duration: twoNumRandom(1500, 2000),           easing: Easing.bounce,         }),       ]),     ).start();   }, []);    const style = useMemo(     () => [       styles.box,       {         left: generateRandom(),         transform: [           {             translateY: value,           },         ],       },     ],     [],   );    return &lt;Animated.View style={style} \/>; };<\/code><\/pre>\n<\/p>\n<\/div>\n<\/details>\n<p>\u041f\u043e\u043b\u0443\u0447\u0430\u0435\u043c \u0432\u043e\u0442 \u0442\u0430\u043a\u043e\u0439 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442:<\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/110\/22b\/298\/11022b298483230c41db95e81106bba7.gif\" alt=\"\u0421\u043d\u0430\u0447\u0430\u043b\u0430 \u0441\u043c\u043e\u0442\u0440\u0438\u043c \u0430\u043d\u0438\u043c\u0430\u043d\u0438\u044e \u043d\u0430 Animated, \u0437\u0430\u0442\u0435\u043c \u043d\u0430 Reanimated\" title=\"\u0421\u043d\u0430\u0447\u0430\u043b\u0430 \u0441\u043c\u043e\u0442\u0440\u0438\u043c \u0430\u043d\u0438\u043c\u0430\u043d\u0438\u044e \u043d\u0430 Animated, \u0437\u0430\u0442\u0435\u043c \u043d\u0430 Reanimated\" width=\"720\" height=\"405\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/110\/22b\/298\/11022b298483230c41db95e81106bba7.gif\"\/><\/p>\n<div><figcaption>\u0421\u043d\u0430\u0447\u0430\u043b\u0430 \u0441\u043c\u043e\u0442\u0440\u0438\u043c \u0430\u043d\u0438\u043c\u0430\u043d\u0438\u044e \u043d\u0430 Animated, \u0437\u0430\u0442\u0435\u043c \u043d\u0430 Reanimated<\/figcaption><\/div>\n<\/figure>\n<div>\n<div class=\"table\">\n<table>\n<tbody>\n<tr>\n<td data-colwidth=\"206\" width=\"206\">\n<p align=\"left\">\n<\/td>\n<td>\n<p align=\"left\"><strong>Animated<\/strong><\/p>\n<\/td>\n<td>\n<p align=\"left\"><strong>Reanimated<\/strong><\/p>\n<\/td>\n<\/tr>\n<tr>\n<td data-colwidth=\"206\" width=\"206\">\n<p align=\"left\"><strong>RAM<\/strong><\/p>\n<\/td>\n<td>\n<p align=\"left\">121<\/p>\n<\/td>\n<td>\n<p align=\"left\">200<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td data-colwidth=\"206\" width=\"206\">\n<p align=\"left\"><strong>CPU(ios)<\/strong><\/p>\n<\/td>\n<td>\n<p align=\"left\">60%<\/p>\n<\/td>\n<td>\n<p align=\"left\">60%<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td data-colwidth=\"206\" width=\"206\">\n<p align=\"left\"><strong>FPS<\/strong><\/p>\n<\/td>\n<td>\n<p align=\"left\">60<\/p>\n<\/td>\n<td>\n<p align=\"left\">60<\/p>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<\/div>\n<p>\u041e\u0431\u0430 \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442\u0430 \u0441\u043f\u0440\u0430\u0432\u0438\u043b\u0438\u0441\u044c \u043d\u0435\u043f\u043b\u043e\u0445\u043e, \u0445\u043e\u0442\u044f \u0432 \u043d\u0430\u0447\u0430\u043b\u0435 \u043f\u0440\u043e\u044f\u0432\u0438\u043b\u0438\u0441\u044c \u043d\u0435\u0431\u043e\u043b\u044c\u0448\u0438\u0435 \u043f\u0440\u043e\u0441\u0430\u0434\u043a\u0438 \u043f\u0440\u0438 \u043f\u043e\u0441\u0442\u0440\u043e\u0435\u043d\u0438\u0438 \u0432\u0438\u0440\u0442\u0443\u0430\u043b\u044c\u043d\u043e\u0433\u043e \u0434\u0435\u0440\u0435\u0432\u0430. \u041e\u0434\u043d\u0430\u043a\u043e \u043f\u0435\u0440\u0444\u043e\u043c\u0430\u043d\u0441 \u043c\u043e\u043d\u0438\u0442\u043e\u0440 \u0441\u0432\u0435\u0440\u0445\u0443 \u043f\u043e\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u0442, \u0447\u0442\u043e Reanimated \u0442\u0440\u0435\u0431\u0443\u0435\u0442\u0441\u044f \u043a\u0430\u043a \u043c\u0438\u043d\u0438\u043c\u0443\u043c \u043d\u0430 60\u043c\u0431 \u0431\u043e\u043b\u044c\u0448\u0435 \u043e\u043f\u0435\u0440\u0430\u0442\u0438\u0432\u043d\u043e\u0439 \u043f\u0430\u043c\u044f\u0442\u0438. <\/p>\n<p>\u041d\u0430\u0433\u0440\u0443\u0437\u043a\u0430 \u043d\u0430 \u0426\u041f \u0432 \u044d\u0442\u043e\u043c \u043a\u0435\u0439\u0441\u0435 \u043e\u0434\u0438\u043d\u0430\u043a\u043e\u0432\u0430\u044f.<\/p>\n<div>\n<div class=\"table\">\n<table>\n<tbody>\n<tr>\n<td colspan=\"2\">\n<p align=\"center\"><strong>\u0420\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u044b \u043f\u0435\u0440\u0432\u043e\u0433\u043e \u044d\u043a\u0441\u043f\u0435\u0440\u0438\u043c\u0435\u043d\u0442\u0430:<\/strong><\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p align=\"left\">\u041f\u043b\u0430\u0432\u043d\u043e\u0441\u0442\u044c \u0430\u043d\u0438\u043c\u0430\u0446\u0438\u0438 (fps)<\/p>\n<\/td>\n<td>\n<p align=\"left\">\u043f\u043e \u043e\u0447\u043a\u0443 Animated \u0438 Reanimated<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p align=\"left\">\u0420\u0430\u0441\u0445\u043e\u0434\u043e\u0432\u0430\u043d\u0438\u0435 \u043f\u0430\u043c\u044f\u0442\u0438<\/p>\n<\/td>\n<td>\n<p align=\"left\">\u043f\u043e\u0431\u0435\u0434\u0438\u043b Animated<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p align=\"left\">\u041d\u0430\u0433\u0440\u0443\u0437\u043a\u0430 \u043d\u0430 \u0426\u041f<\/p>\n<\/td>\n<td>\n<p align=\"left\">\u043f\u043e \u043e\u0447\u043a\u0443 Animated \u0438 Reanimated<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td colspan=\"2\">\n<p align=\"center\"><strong>Animated<\/strong> 3-2 <strong>Reanimated<\/strong><\/p>\n<\/td>\n<\/tr>\n<tr>\n<td colspan=\"2\">\n<p align=\"center\"><strong>\u041f\u0435\u0440\u0432\u044b\u0439 \u0440\u0430\u0443\u043d\u0434 \u0437\u0430 Animated<\/strong><\/p>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<\/div>\n<p><a class=\"anchor\" name=\"12\" id=\"12\"><\/a><\/p>\n<h2>\u042d\u043a\u0441\u043f\u0435\u0440\u0438\u043c\u0435\u043d\u0442 2. \u0414\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u043c scale<\/h2>\n<p>\u0414\u043e\u0431\u0430\u0432\u0438\u043c \u0430\u043d\u0438\u043c\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u043e\u0435 \u0441\u0432\u043e\u0439\u0441\u0442\u0432\u043e scale. \u041f\u043e\u0441\u043c\u043e\u0442\u0440\u0438\u043c, \u043a\u0430\u043a \u0431\u0443\u0434\u0435\u0442 \u0432\u043b\u0438\u044f\u0442\u044c \u043d\u0430 \u043f\u0435\u0440\u0444\u043e\u043c\u0430\u043d\u0441 \u043d\u0430\u043b\u0438\u0447\u0438\u0435 \u0431\u043e\u043b\u044c\u0448\u0435 \u0447\u0435\u043c \u043e\u0434\u043d\u043e\u0433\u043e \u0441\u0432\u043e\u0439\u0441\u0442\u0432\u0430.<\/p>\n<details class=\"spoiler\">\n<summary>\u041a\u043e\u0434 Animated<\/summary>\n<div class=\"spoiler__content\">\n<pre><code class=\"javascript\">export const NativeAnimatedItem = () => {   const value = useRef(new Animated.Value(0)).current;   const scallableValue = useRef(new Animated.Value(0)).current;    useEffect(() => {     Animated.loop(       Animated.sequence([         Animated.timing(scallableValue, {           toValue: twoNumRandom(0.85, 0.95),           useNativeDriver: true,           easing: Easing.bounce,         }),         Animated.timing(scallableValue, {           toValue: twoNumRandom(2.6, 3),           useNativeDriver: true,           easing: Easing.bounce,         }),       ]),     ).start();      Animated.loop(       Animated.sequence([         Animated.timing(value, {           toValue: 834.3333129882812,           useNativeDriver: true,           duration: twoNumRandom(1500, 2000),           easing: Easing.bounce,         }),         Animated.timing(value, {           toValue: 0,           useNativeDriver: true,           duration: twoNumRandom(1500, 2000),           easing: Easing.bounce,         }),       ]),     ).start();   }, []);    const style = useMemo(     () => [       styles.box,       {         left: generateRandom(),         transform: [           {             translateY: value,           },           {scale: scallableValue},         ],       },     ],     [],   );    return &lt;Animated.View style={style} \/>; };<\/code><\/pre>\n<\/p>\n<\/div>\n<\/details>\n<details class=\"spoiler\">\n<summary>\u041a\u043e\u0434 Reanimated<\/summary>\n<div class=\"spoiler__content\">\n<pre><code class=\"javascript\">export const ReanimatedAnimatedItem = () => {   const scallableValue = useDerivedValue(() =>     withRepeat(       withSequence(         withTiming(twoNumRandom(0.85, 0.95)),         withTiming(twoNumRandom(2.6, 3)),       ),       -1,       true,     ),   );    const animation = useDerivedValue(() =>     withRepeat(       withSequence(         withTiming(0, {           duration: twoNumRandom(1500, 2000),           easing: Easing.bounce,         }),         withTiming(1, {           duration: twoNumRandom(1500, 2000),           easing: Easing.bounce,         }),       ),       -1,       true,     ),   );    const animatedStyle = useAnimatedStyle(() => ({     transform: [       {         translateY: interpolate(           animation.value,           [0, 1],           [0, 834.3333129882812],         ),       },       {         scale: scallableValue.value,       },     ],   }));    return (     &lt;Animated.View       style={[styles.box, {left: generateRandom()}, animatedStyle]}     \/>   ); }; <\/code><\/pre>\n<\/p>\n<\/div>\n<\/details>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/2d8\/df9\/5d8\/2d8df95d8474ba106ea471da21911e09.gif\" width=\"720\" height=\"405\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/2d8\/df9\/5d8\/2d8df95d8474ba106ea471da21911e09.gif\"\/><\/figure>\n<div>\n<div class=\"table\">\n<table>\n<tbody>\n<tr>\n<td data-colwidth=\"206\" width=\"206\"><\/td>\n<td data-colwidth=\"248\" width=\"248\">\n<p align=\"left\"><strong>Animated<\/strong><\/p>\n<\/td>\n<td>\n<p align=\"left\"><strong>Reanimated<\/strong><\/p>\n<\/td>\n<\/tr>\n<tr>\n<td data-colwidth=\"206\" width=\"206\">\n<p align=\"left\"><strong>RAM<\/strong><\/p>\n<\/td>\n<td data-colwidth=\"248\" width=\"248\">\n<p align=\"left\">140<\/p>\n<\/td>\n<td>\n<p align=\"left\">240<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td data-colwidth=\"206\" width=\"206\">\n<p align=\"left\"><strong>CPU(iOS)<\/strong><\/p>\n<\/td>\n<td data-colwidth=\"248\" width=\"248\">\n<p align=\"left\">181%<\/p>\n<\/td>\n<td>\n<p align=\"left\">85%<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td data-colwidth=\"206\" width=\"206\">\n<p align=\"left\"><strong>FPS<\/strong><\/p>\n<\/td>\n<td data-colwidth=\"248\" width=\"248\">\n<p align=\"left\">2 (JS-\u043f\u043e\u0442\u043e\u043a)<\/p>\n<\/td>\n<td>\n<p align=\"left\">60<\/p>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<\/div>\n<p>useNativeDriver \u043d\u0435 \u0441\u043f\u0440\u0430\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0441 \u043d\u0430\u0433\u0440\u0443\u0437\u043a\u043e\u0439, \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u043f\u0440\u043e\u0441\u0435\u043b\u043e \u0434\u043e 1 \u043a\u0430\u0434\u0440\u0430 \u0432 \u0441\u0435\u043a\u0443\u043d\u0434\u0443. \u0410 \u0432\u043e\u0442 Reanimated \u043f\u043e\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u0442 \u0442\u0435 \u0436\u0435 \u0441\u0442\u0430\u0431\u0438\u043b\u044c\u043d\u044b\u0435 60 fps.\u00a0<\/p>\n<p>\u041d\u0430\u0433\u0440\u0443\u0437\u043a\u0430 \u043d\u0430 \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u043e\u0440 \u0443 Reanimated \u043d\u0438\u0436\u0435 \u0447\u0435\u043c \u0443 useNativeDriver,\u00a0\u043d\u043e \u043e\u043f\u0435\u0440\u0430\u0442\u0438\u0432\u043d\u043e\u0439 \u043f\u0430\u043c\u044f\u0442\u0438 \u0440\u0430\u0441\u0445\u043e\u0434\u0443\u0435\u0442\u0441\u044f \u043d\u0430 100 \u043c\u0431 \u0431\u043e\u043b\u044c\u0448\u0435. \u0422\u0430\u043a\u0436\u0435, \u043f\u043e\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u043d\u0430 \u043f\u0435\u0440\u0444\u043e\u043c\u0430\u043d\u0441 \u043c\u043e\u043d\u0438\u0442\u043e\u0440 \u0432 Android Studio.<\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/4a6\/c9c\/0d9\/4a6c9c0d9b8a17771fdbae5bb52a2868.png\" alt=\"Perfomance \u043c\u043e\u043d\u0438\u0442\u043e\u0440 \u0432 android studio\" title=\"Perfomance \u043c\u043e\u043d\u0438\u0442\u043e\u0440 \u0432 android studio\" width=\"2942\" height=\"1738\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/4a6\/c9c\/0d9\/4a6c9c0d9b8a17771fdbae5bb52a2868.png\"\/><\/p>\n<div><figcaption>Perfomance \u043c\u043e\u043d\u0438\u0442\u043e\u0440 \u0432 android studio<\/figcaption><\/div>\n<\/figure>\n<p>\u0414\u043b\u044f \u043d\u0430\u0433\u043b\u044f\u0434\u043d\u043e\u0441\u0442\u0438 \u0441\u0440\u0430\u0432\u043d\u0438\u043c \u0440\u0430\u0441\u0445\u043e\u0434 \u043e\u043f\u0435\u0440\u0430\u0442\u0438\u0432\u043d\u043e\u0439 \u043f\u0430\u043c\u044f\u0442\u0438 \u0432 \u043a\u0435\u0439\u0441\u0435 \u0441 \u0448\u0430\u0440\u0438\u043a\u0430\u043c\u0438 \u043d\u0430 \u0440\u0430\u0437\u043d\u043e\u043c \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u0435 \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u043e\u0432.<\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/e45\/9a5\/6fe\/e459a56fecdc9d7586e8a5bcf4c51371.png\" alt=\"\" title=\"\" width=\"2310\" height=\"1140\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/e45\/9a5\/6fe\/e459a56fecdc9d7586e8a5bcf4c51371.png\"\/><\/figure>\n<p>\u0421\u0443\u0449\u0435\u0441\u0442\u0432\u0435\u043d\u043d\u0430\u044f \u0440\u0430\u0437\u043d\u0438\u0446\u0430 \u0437\u0430\u043c\u0435\u0442\u043d\u0430 \u043b\u0438\u0448\u044c \u043d\u0430 1000 \u043d\u043e\u0434\u0430\u0445 \u0438 \u0432\u044b\u0448\u0435. \u041d\u043e \u0432 \u0440\u0435\u0430\u043b\u044c\u043d\u043e\u0441\u0442\u0438 \u0431\u043e\u043b\u044c\u0448\u0435 \u0447\u0435\u043c 100 \u0430\u043d\u0438\u043c\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0445 \u043d\u043e\u0434 \u0432\u0441\u0442\u0440\u0435\u0442\u0438\u0442\u044c \u0442\u044f\u0436\u0435\u043b\u043e. \u0412 \u0440\u0430\u043c\u043a\u0430\u0445 \u044d\u043a\u0441\u043f\u0435\u0440\u0438\u043c\u0435\u043d\u0442\u0430 Reanimated \u0431\u0435\u0440\u0451\u0442 \u0432\u0435\u0440\u0445, \u043d\u043e \u0437\u0430\u043f\u043e\u043c\u043d\u0438\u043c, \u0447\u0442\u043e \u043f\u0440\u0435\u0438\u043c\u0443\u0449\u0435\u0441\u0442\u0432\u043e \u0437\u0434\u0435\u0441\u044c \u0432\u0435\u0441\u044c\u043c\u0430 \u0443\u043c\u043e\u0437\u0440\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0435.<\/p>\n<div>\n<div class=\"table\">\n<table>\n<tbody>\n<tr>\n<td colspan=\"2\">\n<p align=\"center\"><strong>\u0420\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u044b \u044d\u043a\u0441\u043f\u0435\u0440\u0438\u043c\u0435\u043d\u0442\u0430:<\/strong><\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p align=\"left\">\u041f\u043b\u0430\u0432\u043d\u043e\u0441\u0442\u044c \u0430\u043d\u0438\u043c\u0430\u0446\u0438\u0438 (fps)<\/p>\n<\/td>\n<td>\n<p align=\"left\">\u043f\u043e\u0431\u0435\u0434\u0438\u043b Reanimated<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p align=\"left\">\u0420\u0430\u0441\u0445\u043e\u0434\u043e\u0432\u0430\u043d\u0438\u0435 \u043f\u0430\u043c\u044f\u0442\u0438<\/p>\n<\/td>\n<td>\n<p align=\"left\">\u043f\u043e\u0431\u0435\u0434\u0438\u043b Animated<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p align=\"left\">\u041d\u0430\u0433\u0443\u0437\u043a\u0430 \u043d\u0430 \u0426\u041f<\/p>\n<\/td>\n<td>\n<p align=\"left\">\u043f\u043e\u0431\u0435\u0434\u0438\u043b Reanimated<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td colspan=\"2\">\n<p align=\"center\"><strong>Animated<\/strong> 1-2 <strong>Reanimated<\/strong><\/p>\n<\/td>\n<\/tr>\n<tr>\n<td colspan=\"2\">\n<p align=\"center\"><strong>\u0412\u0442\u043e\u0440\u043e\u0439 \u0440\u0430\u0443\u043d\u0434 \u0437\u0430 Reanimated<\/strong><\/p>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<\/div>\n<h3>\u041f\u043e\u0447\u0435\u043c\u0443 \u0442\u0430\u043a \u043f\u0440\u043e\u0438\u0437\u043e\u0448\u043b\u043e?<\/h3>\n<p>\u0414\u0430\u0432\u0430\u0439\u0442\u0435 \u0440\u0430\u0437\u0431\u0438\u0440\u0430\u0442\u044c\u0441\u044f, \u043f\u043e\u0447\u0435\u043c\u0443 \u044d\u043a\u0441\u043f\u0435\u0440\u0438\u043c\u0435\u043d\u0442 1 \u0438 2 \u0434\u0430\u043b\u0438 \u0440\u0430\u0437\u043d\u044b\u0435 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u044b. <\/p>\n<p>\u041d\u0435 \u0432\u0441\u0435 \u043c\u0435\u0442\u043e\u0434\u044b \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u044e\u0442 useNativeDriver. \u0412\u043c\u0435\u0441\u0442\u043e \u044d\u0442\u043e\u0433\u043e \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0430\u0435\u0442\u0441\u044f requestAnimationFrame. Event.start() \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0435\u0442\u0441\u044f \u0432 \u043d\u0430\u0442\u0438\u0432\u043a\u0435, \u0430 \u0432\u043e\u0442 \u043e\u0441\u0442\u0430\u043b\u044c\u043d\u044b\u0435 \u043c\u0435\u0442\u043e\u0434\u044b \u0442\u0440\u0435\u0431\u0443\u044e\u0442 \u043b\u0438\u0448\u043d\u0438\u0439 \u0440\u0430\u0437 \u043f\u0435\u0440\u0435\u0433\u043d\u0430\u0442\u044c \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u0432 JS-\u043f\u043e\u0442\u043e\u043a\u0435. <\/p>\n<p>\u0412 \u0434\u0430\u043d\u043d\u043e\u043c \u043f\u0440\u0438\u043c\u0435\u0440\u0435 \u043c\u044b \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c Sequence \u0434\u043b\u044f \u043e\u0431\u044a\u0435\u0434\u0438\u043d\u0435\u043d\u0438\u044f \u0430\u043d\u0438\u043c\u0430\u0446\u0438\u0439 \u0432 \u0446\u0435\u043f\u043e\u0447\u043a\u0443. \u0418\u0437-\u0437\u0430 \u044d\u0442\u043e\u0433\u043e fps \u043f\u0430\u0434\u0430\u0435\u0442. \u0415\u0441\u043b\u0438 \u0443\u0431\u0440\u0430\u0442\u044c Sequence, \u0442\u043e useNativeDriver \u0431\u0443\u0434\u0435\u0442 \u0432\u043a\u043b\u044e\u0447\u0435\u043d \u0438 \u0430\u043d\u0438\u043c\u0430\u0446\u0438\u0438 \u0441\u0442\u0430\u043d\u0443\u0442 \u0431\u043e\u043b\u0435\u0435 \u043f\u043b\u0430\u0432\u043d\u044b\u043c\u0438.<\/p>\n<p>\u0412 \u0441\u043b\u0443\u0447\u0430\u0435 \u0441 Reanimated \u043e\u0431\u0449\u0435\u043d\u0438\u0435 \u043f\u0440\u043e\u0438\u0441\u0445\u043e\u0434\u0438\u0442 \u0447\u0435\u0440\u0435\u0437 JSI, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 JS-\u043f\u043e\u0442\u043e\u043a \u043d\u0435 \u043f\u0435\u0440\u0435\u0433\u0440\u0443\u0436\u0430\u0435\u0442\u0441\u044f. <\/p>\n<p>\u0414\u0430\u0432\u0430\u0439\u0442\u0435 \u043f\u043e\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u0432 \u043b\u043e\u0433\u0438 \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e MessageQueue \u0434\u043b\u044f \u0431\u043e\u043b\u044c\u0448\u0435\u0433\u043e \u043f\u043e\u043d\u0438\u043c\u0430\u043d\u0438\u044f \u0442\u043e\u0433\u043e \u0447\u0442\u043e \u043f\u0440\u043e\u0438\u0441\u0445\u043e\u0434\u0438\u0442 \u043f\u043e\u0434 \u043a\u0430\u043f\u043e\u0442\u043e\u043c:<\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/36b\/ca1\/138\/36bca1138745db65378907a0549f286e.png\" alt=\"\u0415\u0441\u043b\u0438 \u043a\u043b\u0438\u043a\u043d\u0443\u0442\u044c \u043d\u0430 \u043a\u0430\u0440\u0442\u0438\u043d\u043a\u0443, \u0431\u0443\u0434\u0435\u0442 \u043f\u0440\u043e\u0449\u0435 \u043f\u0440\u043e\u0447\u0438\u0442\u0430\u0442\u044c :)\" title=\"\u0415\u0441\u043b\u0438 \u043a\u043b\u0438\u043a\u043d\u0443\u0442\u044c \u043d\u0430 \u043a\u0430\u0440\u0442\u0438\u043d\u043a\u0443, \u0431\u0443\u0434\u0435\u0442 \u043f\u0440\u043e\u0449\u0435 \u043f\u0440\u043e\u0447\u0438\u0442\u0430\u0442\u044c :)\" width=\"2444\" height=\"1856\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/36b\/ca1\/138\/36bca1138745db65378907a0549f286e.png\"\/><\/p>\n<div><figcaption>\u0415\u0441\u043b\u0438 \u043a\u043b\u0438\u043a\u043d\u0443\u0442\u044c \u043d\u0430 \u043a\u0430\u0440\u0442\u0438\u043d\u043a\u0443, \u0431\u0443\u0434\u0435\u0442 \u043f\u0440\u043e\u0449\u0435 \u043f\u0440\u043e\u0447\u0438\u0442\u0430\u0442\u044c \ud83d\ude42<\/figcaption><\/div>\n<\/figure>\n<p>\u0412 Reanimated \u0441\u043e\u0437\u0434\u0430\u0435\u0442\u0441\u044f \u0442\u0430\u0439\u043c\u0435\u0440 \u0434\u043b\u044f \u0430\u043d\u0438\u043c\u0430\u0446\u0438\u0438 \u0438 \u0441\u0430\u043c\u0430 \u043d\u043e\u0434\u0430. \u041d\u0438\u043a\u0430\u043a\u0438\u0445 \u043b\u0438\u0448\u043d\u0438\u0445 \u0432\u044b\u0437\u043e\u0432\u043e\u0432 \u043d\u0435 \u0432\u0438\u0434\u0438\u043c. Animated + useNativeDriver \u0434\u0435\u043b\u0430\u0435\u0442 \u0442\u043e \u0436\u0435 \u0441\u0430\u043c\u043e\u0435, \u043d\u043e \u0435\u0449\u0451 \u043a\u0430\u0436\u0434\u044b\u0439 \u0440\u0430\u0437 \u0434\u0435\u043b\u0430\u0435\u0442 \u0432\u044b\u0437\u043e\u0432\u044b \u043d\u0430 \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u0435 \u0430\u043d\u0438\u043c\u0430\u0446\u0438\u0438 \u0432 JS-\u043f\u043e\u0442\u043e\u043a\u0435.<\/p>\n<p><a class=\"anchor\" name=\"2\" id=\"2\"><\/a><\/p>\n<h2>\u042d\u043a\u0441\u043f\u0435\u0440\u0438\u043c\u0435\u043d\u0442 3. \u0410\u043d\u0438\u043c\u0430\u0446\u0438\u044f, \u043f\u0440\u0438\u0432\u044f\u0437\u0430\u043d\u043d\u0430\u044f \u043a \u0441\u043a\u0440\u043e\u043b\u043b\u0443<\/h2>\n<p>\u041f\u043e\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u043d\u0430 \u0434\u0440\u0443\u0433\u043e\u0439 \u0432\u0438\u0434 \u0430\u043d\u0438\u043c\u0430\u0446\u0438\u0438 \u2014\u00a0\u043f\u0440\u0438\u0432\u044f\u0437\u0430\u043d\u043d\u044b\u0439 \u043a \u0441\u043a\u0440\u043e\u043b\u043b\u0443. \u0414\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u0443 Animated \u0435\u0441\u0442\u044c \u043c\u0435\u0442\u043e\u0434 <strong>Event<\/strong> \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0441\u043e\u0437\u0434\u0430\u0435\u0442 \u043a\u0430\u0440\u0442\u0443 \u0430\u043d\u0438\u043c\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0445 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0439. \u0410 \u0432 \u0441\u043b\u0443\u0447\u0430\u0435 \u0441 Reanimated \u0441\u043e\u0437\u0434\u0430\u0434\u0438\u043c <strong>shared value<\/strong> \u0434\u043b\u044f \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u0438\u044f \u043f\u043e\u0437\u0438\u0446\u0438\u0438 \u0441\u043a\u0440\u043e\u043b\u043b\u0430. \u0410\u043d\u0438\u043c\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0431\u0443\u0434\u0435\u043c <strong>Lottie <\/strong>\u0430\u043d\u0438\u043c\u0430\u0446\u0438\u044e.<\/p>\n<blockquote>\n<p><em>\u041e\u0431\u0437\u043e\u0440 \u043d\u0430 \u0440\u0430\u0437\u043d\u044b\u0435 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043c\u043e\u0436\u043d\u043e \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0438\u0442\u044c \u043a Reanimated \u043c\u043e\u0436\u043d\u043e \u043f\u0440\u043e\u0447\u0438\u0442\u0430\u0442\u044c \u0435\u0449\u0451 \u0432 \u043e\u0434\u043d\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0435 \u0416\u0435\u043d\u0438: <\/em><a href=\"https:\/\/habr.com\/ru\/companies\/sbermarket\/articles\/725042\/\"><em><u>\u042d\u0444\u0444\u0435\u043a\u0442\u043d\u043e \u0438 \u044d\u0444\u0444\u0435\u043a\u0442\u0438\u0432\u043d\u043e. 6 \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442\u043e\u0432 \u0434\u043b\u044f \u0430\u043d\u0438\u043c\u0430\u0446\u0438\u0438 \u0432 React Native<\/u><\/em><\/a><\/p>\n<\/blockquote>\n<details class=\"spoiler\">\n<summary>\u041a\u043e\u0434 Reanimated<\/summary>\n<div class=\"spoiler__content\">\n<pre><code class=\"javascript\">export const CompareWithScroll = () => {   const scrollY = useSharedValue(0);    return (     &lt;Animated.ScrollView       style={{flex: 1, backgroundColor: '#fff'}}       onScroll={event => {         scrollY.value = event.nativeEvent.contentOffset.y;       }}       scrollEventThrottle={16}>       {new Array(100).fill(0).map(() => (         &lt;LottieReanimated source={lottie} scrollY={scrollY} \/>       ))}     &lt;\/Animated.ScrollView>   ); };  export const LottieReanimated = ({source, scrollY}: Props) => {   const animatedProps = useAnimatedProps(() => ({     progress: interpolate(-scrollY.value, [0, height], [0, 1]),   }));   const styles = useAnimatedStyle(() => ({     left: generateRandom(width),     top: generateRandom(height),   }));    return (     &lt;AnimatedLottieView       style={[ownStyles.view, styles]}       source={source}       animatedProps={animatedProps}     \/>   ); };<\/code><\/pre>\n<\/p>\n<\/div>\n<\/details>\n<details class=\"spoiler\">\n<summary>\u041a\u043e\u0434 Animated<\/summary>\n<div class=\"spoiler__content\">\n<pre><code class=\"javascript\">export const CompareWithScroll = () => {   const scrollY = useRef(new Animated.Value(0));    return (     &lt;Animated.ScrollView       style={{flex: 1, backgroundColor: '#fff'}}       onScroll={Animated.event(         [           {             nativeEvent: {               contentOffset: {y: scrollY.current},             },           },         ],         {useNativeDriver: true},       )}       scrollEventThrottle={16}>       {new Array(100).fill(0).map(() => (         &lt;LottieNative source={lottie} scrollY={scrollY.current} \/>       ))}     &lt;\/Animated.ScrollView>   ); };  export const LottieNative = ({source, scrollY}: Props) => {   const styles = useMemo(     () => [       {         left: generateRandom(width),         top: generateRandom(height),       },     ],     [],   );    return (     &lt;AnimatedLottieView       style={[ownStyles.view, styles]}       source={source}       progress={scrollY.interpolate({         inputRange: [0, height],         outputRange: [0, 1],       })}     \/>   ); };<\/code><\/pre>\n<\/p>\n<\/div>\n<\/details>\n<p>\u0422\u0435\u043f\u0435\u0440\u044c \u0441\u043e\u0437\u0434\u0430\u0434\u0438\u043c \u0441\u0440\u0430\u0437\u0443 100 \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u043e\u0432.<\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/2db\/7a8\/271\/2db7a82710457d3b08169e0decd564de.gif\" width=\"720\" height=\"405\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/2db\/7a8\/271\/2db7a82710457d3b08169e0decd564de.gif\"\/><\/figure>\n<div>\n<div class=\"table\">\n<table>\n<tbody>\n<tr>\n<td data-colwidth=\"206\" width=\"206\"><\/td>\n<td data-colwidth=\"248\" width=\"248\">\n<p align=\"left\"><strong>Animated<\/strong><\/p>\n<\/td>\n<td>\n<p align=\"left\"><strong>Reanimated<\/strong><\/p>\n<\/td>\n<\/tr>\n<tr>\n<td data-colwidth=\"206\" width=\"206\">\n<p align=\"left\"><strong>RAM<\/strong><\/p>\n<\/td>\n<td data-colwidth=\"248\" width=\"248\">\n<p align=\"left\">640<\/p>\n<\/td>\n<td>\n<p align=\"left\">650<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td data-colwidth=\"206\" width=\"206\">\n<p align=\"left\"><strong>CPU(ios)<\/strong><\/p>\n<\/td>\n<td data-colwidth=\"248\" width=\"248\">\n<p align=\"left\">96%<\/p>\n<\/td>\n<td>\n<p align=\"left\">97%<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td data-colwidth=\"206\" width=\"206\">\n<p align=\"left\"><strong>FPS<\/strong><\/p>\n<\/td>\n<td data-colwidth=\"248\" width=\"248\">\n<p align=\"left\">25-35<\/p>\n<\/td>\n<td>\n<p align=\"left\">1<\/p>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<\/div>\n<p>\u041f\u043e \u043e\u043f\u0435\u0440\u0430\u0442\u0438\u0432\u043d\u043e\u0439 \u043f\u0430\u043c\u044f\u0442\u0438 \u0432\u0438\u0434\u0438\u043c, \u0447\u0442\u043e \u0440\u0430\u0437\u043d\u0438\u0446\u044b \u043f\u0440\u0430\u043a\u0442\u0438\u0447\u0435\u0441\u043a\u0438 \u043d\u0435\u0442, \u043d\u043e Reanimated \u043f\u0440\u043e\u0441\u0435\u043b \u0434\u043e 1 fps. Animated + useNativeDriver \u0434\u0435\u0440\u0436\u0438\u0442\u0441\u044f \u0432 \u043f\u0440\u0435\u0434\u0435\u043b\u0430\u0445 20-30 fps.<\/p>\n<p>\u0412 \u044d\u0442\u043e\u043c \u043a\u0435\u0439\u0441\u0435 \u043d\u0430\u0433\u0440\u0443\u0437\u043a\u0430 \u043d\u0430 \u0426\u041f \u043e\u0434\u0438\u043d\u0430\u043a\u043e\u0432\u0430\u044f.<\/p>\n<div>\n<div class=\"table\">\n<table>\n<tbody>\n<tr>\n<td colspan=\"2\">\n<p align=\"center\"><strong>\u0420\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u044b \u044d\u043a\u0441\u043f\u0435\u0440\u0438\u043c\u0435\u043d\u0442\u0430:<\/strong><\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p align=\"left\">\u041f\u043b\u0430\u0432\u043d\u043e\u0441\u0442\u044c \u0430\u043d\u0438\u043c\u0430\u0446\u0438\u0438 (fps)<\/p>\n<\/td>\n<td>\n<p align=\"left\">\u043f\u043e\u0431\u0435\u0434\u0438\u043b Animated<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p align=\"left\">\u0420\u0430\u0441\u0445\u043e\u0434\u043e\u0432\u0430\u043d\u0438\u0435 \u043f\u0430\u043c\u044f\u0442\u0438<\/p>\n<\/td>\n<td>\n<p align=\"left\">\u043d\u0438\u0447\u044c\u044f<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p align=\"left\">\u041d\u0430\u0433\u0443\u0437\u043a\u0430 \u043d\u0430 \u0426\u041f<\/p>\n<\/td>\n<td>\n<p align=\"left\">\u043d\u0438\u0447\u044c\u044f<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td colspan=\"2\">\n<p align=\"center\"><strong>Animated<\/strong> 3-2 <strong>Reanimated<\/strong><\/p>\n<\/td>\n<\/tr>\n<tr>\n<td colspan=\"2\">\n<p align=\"center\"><strong>\u0422\u0440\u0435\u0442\u0438\u0439 \u0440\u0430\u0443\u043d\u0434 \u0437\u0430 Animated<\/strong><\/p>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<\/div>\n<p><a class=\"anchor\" name=\"fin\" id=\"fin\"><\/a><\/p>\n<h2>\u0422\u0430\u043a \u043a\u0442\u043e \u0431\u044b\u0441\u0442\u0440\u0435\u0435?<\/h2>\n<p>Animated \u043f\u043e\u0431\u0435\u0434\u0438\u043b, \u0445\u043e\u0442\u044c \u0438 \u0434\u0430\u043b \u0441\u043b\u0430\u0431\u0438\u043d\u0443 \u0432\u043e \u0432\u0442\u043e\u0440\u043e\u043c \u044d\u043a\u0441\u043f\u0435\u0440\u0438\u043c\u0435\u043d\u0442\u0435. \u041e\u043f\u0435\u0440\u0430\u0442\u0438\u0432\u043d\u0430\u044f \u043f\u0430\u043c\u044f\u0442\u044c \u0441\u0438\u043b\u044c\u043d\u0435\u0435 \u0440\u0430\u0441\u0445\u043e\u0434\u0443\u0435\u0442\u0441\u044f \u0432 Reanimated, \u0430 Animated + useNativeDriver \u0441\u0438\u043b\u044c\u043d\u0435\u0435 \u043d\u0430\u0433\u0440\u0443\u0436\u0430\u0435\u0442 \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u043e\u0440.<\/p>\n<div>\n<div class=\"table\">\n<table>\n<tbody>\n<tr>\n<td colspan=\"4\" data-colwidth=\"0,0,172,0\" width=\"0\">\n<p align=\"center\"><strong>\u0418\u0442\u043e\u0433\u043e\u0432\u044b\u0439 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442:<\/strong><\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p align=\"left\">\n<\/td>\n<td>\n<p align=\"left\">\u044d\u043a\u0441\u043f\u0435\u0440\u0438\u043c\u0435\u043d\u0442 1<\/p>\n<\/td>\n<td data-colwidth=\"172\" width=\"172\">\n<p align=\"left\">\u044d\u043a\u0441\u043f\u0435\u0440\u0438\u043c\u0435\u043d\u0442 2<\/p>\n<\/td>\n<td>\n<p align=\"left\">\u044d\u043a\u0441\u043f\u0435\u0440\u0438\u043c\u0435\u043d\u0442 3<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p align=\"left\">\u041f\u043b\u0430\u0432\u043d\u043e\u0441\u0442\u044c \u0430\u043d\u0438\u043c\u0430\u0446\u0438\u0438 (fps)<\/p>\n<\/td>\n<td>\n<p align=\"center\">R, A<\/p>\n<\/td>\n<td data-colwidth=\"172\" width=\"172\">\n<p align=\"center\">R<\/p>\n<\/td>\n<td>\n<p align=\"center\">A<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p align=\"left\">\u0420\u0430\u0441\u0445\u043e\u0434\u043e\u0432\u0430\u043d\u0438\u0435 \u043f\u0430\u043c\u044f\u0442\u0438<\/p>\n<\/td>\n<td>\n<p align=\"center\">A<\/p>\n<\/td>\n<td data-colwidth=\"172\" width=\"172\">\n<p align=\"center\">A<\/p>\n<\/td>\n<td>\n<p align=\"center\">R, A<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p align=\"left\">\u041d\u0430\u0433\u0443\u0437\u043a\u0430 \u043d\u0430 \u0426\u041f<\/p>\n<\/td>\n<td>\n<p align=\"center\">R, A<\/p>\n<\/td>\n<td data-colwidth=\"172\" width=\"172\">\n<p align=\"center\">R<\/p>\n<\/td>\n<td>\n<p align=\"center\">R, A<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td colspan=\"4\" data-colwidth=\"0,0,172,0\" width=\"0\">\n<p align=\"center\"><strong>Animated<\/strong> 7-6 <strong>Reanimated<\/strong><\/p>\n<\/td>\n<\/tr>\n<tr>\n<td colspan=\"4\" data-colwidth=\"0,0,172,0\" width=\"0\">\n<p align=\"center\"><strong>Animated <\/strong>?<\/p>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<\/div>\n<p>\u041f\u043e \u0444\u0430\u043a\u0442\u0443 \u0436\u0435 \u0432\u0441\u0435 \u0437\u0430\u0432\u0438\u0441\u0438\u0442 \u043e\u0442 \u043a\u043e\u043d\u0442\u0435\u043a\u0441\u0442\u0430. \u041d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u0432 \u044d\u043a\u0441\u043f\u0435\u0440\u0438\u043c\u0435\u043d\u0442\u0435 2 Reanimated \u0432\u044b\u0440\u0432\u0430\u043b \u043f\u043e\u0431\u0435\u0434\u0443 \u0443 Animated \u043f\u043e \u043f\u043b\u0430\u0432\u043d\u043e\u0441\u0442\u0438 \u0430\u043d\u0438\u043c\u0430\u0446\u0438\u0438 \u043f\u0440\u0438 \u0432\u0435\u0441\u044c\u043c\u0430 \u043d\u0435\u0440\u0435\u0430\u043b\u0438\u0441\u0442\u0438\u0447\u043d\u044b\u0445 \u0434\u043b\u044f \u043d\u0430\u0441\u0442\u043e\u044f\u0449\u0435\u0433\u043e \u043f\u0440\u043e\u0435\u043a\u0442\u0430 \u043f\u0440\u0435\u0434\u043f\u043e\u0441\u044b\u043b\u043a\u0430\u0445.<\/p>\n<p>\u0418\u0442\u043e\u0433\u043e, \u043d\u0430 \u043d\u0435\u0431\u043e\u043b\u044c\u0448\u0438\u0445 \u043f\u0440\u043e\u0435\u043a\u0442\u0430\u0445 \u043c\u043e\u0436\u043d\u043e \u0432 \u043f\u0440\u0438\u043d\u0446\u0438\u043f\u0435 \u043d\u0435 \u0437\u0430\u0434\u0443\u043c\u044b\u0432\u0430\u0442\u044c\u0441\u044f \u043e \u0441\u043a\u043e\u0440\u043e\u0441\u0442\u0438 \u0438 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c, \u0447\u0442\u043e \u043f\u043e\u043d\u0440\u0430\u0432\u0438\u0442\u0441\u044f. Reanimated \u043f\u043e\u043a\u0440\u044b\u0432\u0430\u0435\u0442 \u043f\u043e\u0447\u0442\u0438 \u0432\u0441\u0435 \u043a\u0435\u0439\u0441\u044b, \u043d\u043e, \u0432 \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u0441\u043b\u0443\u0447\u0430\u044f\u0445, \u0445\u0443\u0436\u0435 \u043f\u043e \u043f\u0435\u0440\u0444\u043e\u043c\u0430\u043d\u0441\u0443. \u0412 \u0442\u043e \u0432\u0440\u0435\u043c\u044f \u043a\u0430\u043a useNativeDriver \u0438\u043c\u0435\u0435\u0442 \u043e\u0433\u0440\u0430\u043d\u0438\u0447\u0435\u043d\u0438\u044f \u0438 \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u0430\u043d\u0438\u043c\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0442\u043e\u043b\u044c\u043a\u043e \u0431\u0430\u0437\u043e\u0432\u044b\u0435 \u0441\u0432\u043e\u0439\u0441\u0442\u0432\u0430. \u0415\u0441\u043b\u0438 \u043d\u0443\u0436\u043d\u043e \u0430\u043d\u0438\u043c\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u043c\u0430\u043a\u0435\u0442(width, height \u0438 \u0442.\u0434), \u0442\u043e \u0442\u043e\u0447\u043d\u043e \u043f\u0440\u0438\u0441\u043c\u0430\u0442\u0440\u0438\u0432\u0430\u0435\u043c\u0441\u044f \u043a Reanimated.<\/p>\n<p>\u0410 \u0432\u043e\u0442 \u0438 \u0444\u0438\u043d\u0430\u043b\u044c\u043d\u043e\u0435 \u0441\u0440\u0430\u0432\u043d\u0435\u043d\u0438\u0435 \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442\u043e\u0432:<\/p>\n<div>\n<div class=\"table\">\n<table>\n<tbody>\n<tr>\n<td data-colwidth=\"92\" width=\"92\">\n<p align=\"left\">\n<\/td>\n<td data-colwidth=\"292\" width=\"292\">\n<p align=\"center\"><strong>Reanimated<\/strong><\/p>\n<\/td>\n<td>\n<p align=\"center\"><strong>Animated<\/strong><\/p>\n<\/td>\n<\/tr>\n<tr>\n<td data-colwidth=\"92\" width=\"92\">\n<p align=\"center\"><strong>+<\/strong><\/p>\n<\/td>\n<td data-colwidth=\"292\" width=\"292\">\n<p align=\"left\">\u041f\u043e\u043a\u0440\u044b\u0432\u0430\u0435\u0442 \u043f\u043e\u0447\u0442\u0438 \u0432\u0441\u0435 \u043a\u0435\u0439\u0441\u044b<\/p>\n<p>\u0423\u0434\u043e\u0431\u043d\u044b\u0439 API<\/p>\n<\/td>\n<td>\n<p align=\"left\">\u0418\u0434\u0435\u0442 \u0438\u0437 \u043a\u043e\u0440\u043e\u0431\u043a\u0438<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td data-colwidth=\"92\" width=\"92\">\n<p align=\"center\"><strong>\u2013<\/strong><\/p>\n<\/td>\n<td data-colwidth=\"292\" width=\"292\">\n<p>\u0411\u043e\u043b\u044c\u0448\u043e\u0439 \u0440\u0430\u0437\u043c\u0435\u0440 \u0438\u0441\u0445\u043e\u0434\u043d\u0438\u043a\u043e\u0432(3\u043c\u0431)<\/p>\n<p>\u0415\u0441\u0442 \u043c\u043d\u043e\u0433\u043e \u043e\u043f\u0435\u0440\u0430\u0442\u0438\u0432\u043d\u043e\u0439 \u043f\u0430\u043c\u044f\u0442\u0438<\/p>\n<\/td>\n<td>\n<p>\u0415\u0441\u0442 \u0440\u0435\u0441\u0443\u0440\u0441\u044b \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u043e\u0440\u0430<\/p>\n<p>\u041d\u0435 \u0432\u0441\u0435 \u0441\u0432\u043e\u0439\u0441\u0442\u0432\u0430 \u043c\u043e\u0436\u043d\u043e \u0430\u043d\u0438\u043c\u0438\u0440\u043e\u0432\u0430\u0442\u044c<\/p>\n<p>\u041d\u0435 \u0432\u0441\u0435 \u043c\u0435\u0442\u043e\u0434\u044b \u0440\u0430\u0431\u043e\u0442\u0430\u044e\u0442 \u0441 useNativeDriver<\/p>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<\/div>\n<p>\u0421\u043f\u0430\u0441\u0438\u0431\u043e \u0442\u0435\u043c, \u043a\u0442\u043e \u0434\u043e\u0447\u0438\u0442\u0430\u043b \u0434\u043e \u043a\u043e\u043d\u0446\u0430! \u041d\u0430\u0434\u0435\u044e\u0441\u044c, \u0431\u044b\u043b\u043e \u043f\u043e\u043b\u0435\u0437\u043d\u043e (\u0438 \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u043e). \u0415\u0441\u043b\u0438 \u0435\u0441\u0442\u044c, \u0447\u0442\u043e \u0440\u0430\u0441\u0441\u043a\u0430\u0437\u0430\u0442\u044c \u043d\u0430 \u0442\u0435\u043c\u0443 \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u0438 Animated \u0438 Reanimated, \u0431\u0443\u0434\u0443 \u0436\u0434\u0430\u0442\u044c \u0432\u0430\u0441 \u0432 \u043a\u043e\u043c\u043c\u0435\u043d\u0442\u0430\u0440\u0438\u044f\u0445 \ud83d\ude42<\/p>\n<blockquote>\n<p><em>Tech-\u043a\u043e\u043c\u0430\u043d\u0434\u0430 \u0421\u0431\u0435\u0440\u041c\u0430\u0440\u043a\u0435\u0442\u0430 \u0432\u0435\u0434\u0435\u0442 \u0441\u043e\u0446\u0441\u0435\u0442\u0438 \u0441 \u043d\u043e\u0432\u043e\u0441\u0442\u044f\u043c\u0438 \u0438 \u0430\u043d\u043e\u043d\u0441\u0430\u043c\u0438. \u0415\u0441\u043b\u0438 \u0445\u043e\u0447\u0435\u0448\u044c \u0443\u0437\u043d\u0430\u0442\u044c, \u0447\u0442\u043e \u043f\u043e\u0434 \u043a\u0430\u043f\u043e\u0442\u043e\u043c \u0432\u044b\u0441\u043e\u043a\u043e\u043d\u0430\u0433\u0440\u0443\u0436\u0435\u043d\u043d\u043e\u0433\u043e e-commerce, \u0441\u043b\u0435\u0434\u0438 \u0437\u0430 \u043d\u0430\u043c\u0438 \u0432 <\/em><a href=\"https:\/\/t.me\/sbermarket_tech\"><em>Telegram<\/em><\/a><em> \u0438 \u043d\u0430\u00a0 <\/em><a href=\"https:\/\/www.youtube.com\/channel\/UC8WjHJcS5ZhN2uV4de4o6Jg\"><em><u>YouTube<\/u><\/em><\/a><em>. \u0410 \u0442\u0430\u043a\u0436\u0435 \u0441\u043b\u0443\u0448\u0430\u0439 <\/em><a href=\"https:\/\/bit.ly\/dlya-tech-i-etich-podcast\"><em><u>\u043f\u043e\u0434\u043a\u0430\u0441\u0442 \u00ab\u0414\u043b\u044f tech \u0438 \u044d\u0442\u0438\u0445\u00bb<\/u><\/em><\/a><em> \u043e\u0442 \u043d\u0430\u0448\u0438\u0445 it-\u043c\u0435\u043d\u0435\u0434\u0436\u0435\u0440\u043e\u0432.<\/em> <\/p>\n<\/blockquote>\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\/765338\/\"> https:\/\/habr.com\/ru\/articles\/765338\/<\/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\"><\/figure>\n<p>\u041f\u0440\u0438\u0432\u0435\u0442! \u041c\u0435\u043d\u044f \u0437\u043e\u0432\u0443\u0442 \u0414\u0435\u043d\u0438\u0441, \u044f \u043c\u043e\u0431\u0438\u043b\u044c\u043d\u044b\u0439 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a \u0432 \u0421\u0431\u0435\u0440\u041c\u0430\u0440\u043a\u0435\u0442\u0435. \u041f\u0438\u0448\u0443 \u043d\u0430 React Native \u0438 \u043b\u044e\u0431\u043b\u044e \u0430\u043d\u0438\u043c\u0430\u0446\u0438\u0438, \u0432\u0435\u0434\u044c \u043e\u043d\u0438 \u0434\u0430\u044e\u0442 \u0436\u0438\u0437\u043d\u044c \u043d\u0430\u0448\u0438\u043c \u043f\u0440\u043e\u0435\u043a\u0442\u0430\u043c \ud83d\ude42<\/p>\n<p>\u0412 \u044d\u0442\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0435 \u043f\u043e\u043f\u0440\u043e\u0431\u0443\u0435\u043c \u0440\u0430\u0437\u043e\u0431\u0440\u0430\u0442\u044c\u0441\u044f, \u0447\u0442\u043e \u0436\u0435 \u0432\u0441\u0451-\u0442\u0430\u043a\u0438 \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u0431\u044b\u0441\u0442\u0440\u0435\u0435: <strong>React-Native-Reanimated<\/strong> \u0438\u043b\u0438 <strong>Animated + useNativeDriver: true<\/strong>.<\/p>\n<p>\u0411\u0443\u0434\u0435\u043c \u0441\u0440\u0430\u0432\u043d\u0438\u0432\u0430\u0442\u044c FPS, \u043d\u0430\u0433\u0440\u0443\u0437\u043a\u0443 \u043d\u0430 \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u043e\u0440, \u043e\u043f\u0435\u0440\u0430\u0442\u0438\u0432\u043d\u0443\u044e \u043f\u0430\u043c\u044f\u0442\u044c \u0438 \u0432\u043e\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f EventQueue \u0434\u043b\u044f \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u0438\u044f \u043b\u043e\u0433\u043e\u0432.<\/p>\n<p><strong><em>\u0414\u0438\u0441\u043a\u043b\u0435\u0439\u043c\u0435\u0440: <\/em><\/strong><em>\u042d\u0442\u043e \u0442\u0435\u043e\u0440\u0435\u0442\u0438\u0447\u0435\u0441\u043a\u043e\u0435 \u0441\u0440\u0430\u0432\u043d\u0435\u043d\u0438\u0435 \u043d\u0430 \u0430\u0431\u0441\u0442\u0440\u0430\u043a\u0442\u043d\u044b\u0445 \u043f\u0440\u0438\u043c\u0435\u0440\u0430\u0445, \u0442\u0430\u043a \u0447\u0442\u043e \u043f\u0435\u0440\u0444\u043e\u043c\u0430\u043d\u0441 \u043d\u0430 \u0440\u0435\u0430\u043b\u044c\u043d\u044b\u0445 \u043f\u0440\u043e\u0435\u043a\u0442\u0430\u0445 \u043c\u043e\u0436\u0435\u0442 \u043e\u0442\u043b\u0438\u0447\u0430\u0442\u044c\u0441\u044f. \u041d\u043e \u044f \u043f\u043e\u0441\u0442\u0430\u0440\u0430\u043b\u0441\u044f \u043d\u0430\u0433\u0440\u0443\u0437\u0438\u0442\u044c \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442\u044b \u043a\u0430\u043a \u0441\u043b\u0435\u0434\u0443\u0435\u0442 \u0438 \u0445\u043e\u0440\u043e\u0448\u0435\u043d\u044c\u043a\u043e \u043f\u0440\u043e\u0432\u0435\u0440\u0438\u0442\u044c \u0438\u0445 \u043d\u0430 \u043f\u0440\u043e\u0447\u043d\u043e\u0441\u0442\u044c. <\/em><\/p>\n<p><a href=\"#why\">\u041f\u043e\u0447\u0435\u043c\u0443 \u0438\u043c\u0435\u043d\u043d\u043e \u044d\u0442\u043e\u0442 \u044d\u043a\u0441\u043f\u0435\u0440\u0438\u043c\u0435\u043d\u0442?<\/a><\/p>\n<p><a href=\"#11\">\u042d\u043a\u0441\u043f\u0435\u0440\u0438\u043c\u0435\u043d\u0442 1. \u0422\u0435\u0441\u0442\u0438\u0440\u0443\u0435\u043c loop \u0430\u043d\u0438\u043c\u0430\u0446\u0438\u044e <\/a><\/p>\n<p><a href=\"#12\">\u042d\u043a\u0441\u043f\u0435\u0440\u0438\u043c\u0435\u043d\u0442 2. \u0414\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u043c scale<\/a><\/p>\n<p><a href=\"#2\">\u042d\u043a\u0441\u043f\u0435\u0440\u0438\u043c\u0435\u043d\u0442 3. \u0410\u043d\u0438\u043c\u0430\u0446\u0438\u044f, \u043f\u0440\u0438\u0432\u044f\u0437\u0430\u043d\u043d\u0430\u044f \u043a \u0441\u043a\u0440\u043e\u043b\u043b\u0443<\/a><\/p>\n<p><a href=\"#fin\">\u0422\u0430\u043a \u043a\u0442\u043e \u0431\u044b\u0441\u0442\u0440\u0435\u0435?<\/a><\/p>\n<p><a class=\"anchor\" name=\"why\" id=\"why\"><\/a><\/p>\n<h2>\u041f\u043e\u0447\u0435\u043c\u0443 \u0438\u043c\u0435\u043d\u043d\u043e \u044d\u0442\u043e\u0442 \u044d\u043a\u0441\u043f\u0435\u0440\u0438\u043c\u0435\u043d\u0442?<\/h2>\n<p>\u041d\u0435 \u0442\u0430\u043a \u0434\u0430\u0432\u043d\u043e \u043c\u043e\u0439 \u043a\u043e\u043b\u043b\u0435\u0433\u0430 \u0416\u0435\u043d\u044f \u041f\u0440\u043e\u043a\u043e\u043f\u044c\u0435\u0432 (aka <a href=\"https:\/\/habr.com\/ru\/users\/Evgen175\/\"><u>@Evgen175<\/u><\/a>) \u043e\u043f\u0443\u0431\u043b\u0438\u043a\u043e\u0432\u0430\u043b \u043d\u0430 \u0425\u0430\u0431\u0440\u0435 \u0441\u0442\u0430\u0442\u044c\u044e \u0432 \u0434\u0432\u0443\u0445 \u0447\u0430\u0441\u0442\u044f\u0445 \u043e \u0442\u043e\u043c, \u043f\u043e\u0447\u0435\u043c\u0443 \u0430\u043d\u0438\u043c\u0430\u0446\u0438\u0438 \u0432 React Native \u0440\u0430\u0431\u043e\u0442\u0430\u044e\u0442 \u0438\u043c\u0435\u043d\u043d\u043e \u0442\u0430\u043a, \u043a\u0430\u043a \u0440\u0430\u0431\u043e\u0442\u0430\u044e\u0442. \u0426\u0435\u043b\u044c \u0441\u0435\u0440\u0438\u0438 \u2014\u00a0<strong>\u043e\u0431\u044a\u044f\u0441\u043d\u0438\u0442\u044c, \u043e\u0442\u043a\u0443\u0434\u0430 \u0431\u0435\u0440\u0443\u0442\u0441\u044f \u043b\u0430\u0433\u0438 \u0432 \u0430\u043d\u0438\u043c\u0430\u0446\u0438\u044f\u0445, \u0437\u0430 \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043c\u043d\u043e\u0433\u0438\u0435 \u0442\u0430\u043a \u043d\u0435 \u043b\u044e\u0431\u044f\u0442 RN<\/strong>, \u0438 \u0434\u0430\u0442\u044c \u0441\u043e\u0432\u0435\u0442\u044b, \u0434\u043b\u044f \u043a\u0430\u043a\u0438\u0445 \u0441\u043b\u0443\u0447\u0430\u0435\u0432 \u043b\u0443\u0447\u0448\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0440\u0430\u0437\u043d\u044b\u0435 \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442\u044b.<\/p>\n<ul>\n<li>\n<p><a href=\"https:\/\/habr.com\/ru\/companies\/sbermarket\/articles\/748724\/\">\u041f\u043e\u0434 \u043a\u0430\u043f\u043e\u0442\u043e\u043c \u0430\u043d\u0438\u043c\u0430\u0446\u0438\u0439 \u0432 React Native. \u0427\u0430\u0441\u0442\u044c 1\/2: Animated and Bridge<\/a><\/p>\n<\/li>\n<li>\n<p><a href=\"https:\/\/habr.com\/ru\/companies\/sbermarket\/articles\/750000\/\">\u041f\u043e\u0434 \u043a\u0430\u043f\u043e\u0442\u043e\u043c \u0430\u043d\u0438\u043c\u0430\u0446\u0438\u0439 \u0432 React Native. \u0427\u0430\u0441\u0442\u044c 2\/2: Reanimated and JSI<\/a><\/p>\n<\/li>\n<\/ul>\n<p>\u0412 \u0444\u0438\u043d\u0430\u043b\u0435 \u043f\u043e\u043b\u0443\u0447\u0438\u043b\u0438\u0441\u044c \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0435 \u0432\u044b\u0432\u043e\u0434\u044b:<\/p>\n<div>\n<div class=\"table\">\n<table>\n<tbody>\n<tr>\n<td colspan=\"2\">\n<p align=\"center\">\u041a\u0430\u043a\u043e\u0439 \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442 \u0432\u044b\u0431\u0440\u0430\u0442\u044c?<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p align=\"center\"><strong>Animated<\/strong><\/p>\n<\/td>\n<td>\n<p align=\"center\"><strong>Reanimated<\/strong><\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p>\u0414\u043b\u044f \u043f\u0440\u043e\u0441\u0442\u044b\u0445 \u0430\u043d\u0438\u043c\u0430\u0446\u0438\u0439<\/p>\n<p>\u041a\u043e\u0433\u0434\u0430 \u043d\u0430\u0434\u043e \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u0430\u043d\u0438\u043c\u0430\u0446\u0438\u044e, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u043d\u0435 \u043f\u0435\u0440\u0435\u0440\u0438\u0441\u043e\u0432\u044b\u0432\u0430\u0435\u0442 \u043c\u0430\u043a\u0435\u0442: transform, opacity, borderRadius \u0438 \u0434\u0440.<\/p>\n<p>(!) \u0412\u0441\u0435\u0433\u0434\u0430 \u043d\u0430\u0434\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c useNativeDriver: true<\/p>\n<\/td>\n<td>\n<p>\u0415\u0441\u043b\u0438 \u0441\u0432\u043e\u0439\u0441\u0442\u0432\u0430, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043d\u0430\u0434\u043e \u0430\u043d\u0438\u043c\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u043f\u0435\u0440\u0435\u0440\u0438\u0441\u043e\u0432\u044b\u0432\u0430\u044e\u0442 \u043c\u0430\u043a\u0435\u0442<\/p>\n<p>\u0415\u0441\u043b\u0438 \u043d\u0430\u0434\u043e \u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u0442\u044c \u0441\u043b\u043e\u0436\u043d\u0443\u044e \u0430\u043d\u0438\u043c\u0430\u0446\u0438\u044e, \u0433\u0434\u0435 \u0440\u0430\u0437\u043d\u044b\u0435 \u0441\u0432\u043e\u0439\u0441\u0442\u0432\u0430 \u0437\u0430\u0432\u0438\u0441\u044f\u0442 \u0434\u0440\u0443\u0433 \u043e\u0442 \u0434\u0440\u0443\u0433\u0430<\/p>\n<p>\u041a\u043e\u0433\u0434\u0430 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c \u0436\u0435\u0441\u0442\u044b<\/p>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<\/div>\n<p>\u0410 \u0435\u0449\u0451 \u043f\u043e\u044f\u0432\u0438\u043b\u0430\u0441\u044c \u0433\u0438\u043f\u043e\u0442\u0435\u0437\u0430:<\/p>\n<blockquote>\n<p>Animated \u0441 useNativeDriver \u043e\u0442\u043f\u0440\u0430\u0432\u043b\u044f\u0435\u0442 \u0433\u0440\u0430\u0444, \u043e\u043f\u0438\u0441\u044b\u0432\u0430\u044e\u0449\u0438\u0439 \u0430\u043d\u0438\u043c\u0430\u0446\u0438\u044e, \u0434\u043b\u044f \u0440\u0430\u0441\u0447\u0435\u0442\u0430 \u043d\u0430 UI, \u0430 Reanimated \u0434\u0435\u043b\u0430\u0435\u0442 \u0432\u0441\u0435 \u0440\u0430\u0441\u0447\u0435\u0442\u044b \u043d\u0430 \u0441\u0442\u043e\u0440\u043e\u043d\u0435 JS. <\/p>\n<p>\u0412\u043e\u0437\u043c\u043e\u0436\u043d\u043e \u0438\u0437-\u0437\u0430 \u043c\u0435\u043d\u044c\u0448\u0435\u0433\u043e \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u0430 \u00ab\u043d\u0430\u043a\u043b\u0430\u0434\u043d\u044b\u0445 \u0440\u0430\u0441\u0445\u043e\u0434\u043e\u0432\u00bb <strong>Animated \u0431\u0443\u0434\u0435\u0442 \u0438\u043c\u0435\u0442\u044c \u043b\u0443\u0447\u0448\u0443\u044e \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u044c \u0438 \u0431\u0443\u0434\u0435\u0442 \u043c\u0435\u043d\u044c\u0448\u0435 \u043f\u043e\u0442\u0440\u0435\u0431\u043b\u044f\u0442\u044c \u043f\u0430\u043c\u044f\u0442\u044c<\/strong> \u0434\u043b\u044f \u0442\u0435\u0445 \u043a\u0435\u0439\u0441\u043e\u0432, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043c\u043e\u0436\u043d\u043e \u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u0442\u044c \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u043e\u0431\u043e\u0438\u0445 \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442\u043e\u0432.<\/p>\n<\/blockquote>\n<p>\u041d\u0443 \u0447\u0442\u043e \u0436, \u043f\u0435\u0440\u0435\u0445\u0432\u0430\u0442\u044b\u0432\u0430\u044e \u044d\u0441\u0442\u0430\u0444\u0435\u0442\u0443. \u0425\u043e\u0447\u0435\u0442\u0441\u044f \u0440\u0430\u0437 \u0438 \u043d\u0430\u0432\u0441\u0435\u0433\u0434\u0430 \u0432\u044b\u044f\u0441\u043d\u0438\u0442\u044c, \u0434\u043b\u044f \u043a\u0430\u043a\u0438\u0445 \u043a\u0435\u0439\u0441\u043e\u0432 \u0447\u0442\u043e \u043e\u043f\u0442\u0438\u043c\u0430\u043b\u044c\u043d\u0435\u0435.<\/p>\n<p>\u0412 \u043a\u0440\u0430\u0441\u043d\u043e\u043c \u0443\u0433\u043b\u0443 \u0440\u0438\u043d\u0433\u0430 \u2014\u00a0Animated. \u0412 \u0441\u0438\u043d\u0435\u043c \u2014\u00a0Reanimated. \u041f\u043e\u0435\u0445\u0430\u043b\u0438!<\/p>\n<p><a class=\"anchor\" name=\"11\" id=\"11\"><\/a><\/p>\n<h2>\u042d\u043a\u0441\u043f\u0435\u0440\u0438\u043c\u0435\u043d\u0442 1. \u0422\u0435\u0441\u0442\u0438\u0440\u0443\u0435\u043c loop \u0430\u043d\u0438\u043c\u0430\u0446\u0438\u044e <\/h2>\n<p>\u0412\u043e\u0437\u044c\u043c\u0435\u043c 500 \u0448\u0430\u0440\u0438\u043a\u043e\u0432 \u0441 \u0430\u043d\u0438\u043c\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u043c translateY, \u0447\u0442\u043e\u0431\u044b \u0431\u044b\u043b\u043e \u043d\u0430\u0433\u043b\u044f\u0434\u043d\u0435\u0435. \u0414\u043e\u0431\u0430\u0432\u0438\u043c loop \u0438 \u043d\u0430\u043a\u0438\u043d\u0435\u043c easing \u0444\u0443\u043d\u043a\u0446\u0438\u044e.<\/p>\n<details class=\"spoiler\">\n<summary>\u041a\u043e\u0434 Reanimated<\/summary>\n<div class=\"spoiler__content\">\n<pre><code class=\"javascript\">export const ReanimatedAnimatedItem = () => {   const animation = useDerivedValue(() =>     withRepeat(       withSequence(         withTiming(0, {           duration: twoNumRandom(1500, 2000),           easing: Easing.bounce,         }),         withTiming(1, {           duration: twoNumRandom(1500, 2000),           easing: Easing.bounce,         }),       ),       -1,       true,     ),   );    const animatedStyle = useAnimatedStyle(() => ({     transform: [       {         translateY: interpolate(           animation.value,           [0, 1],           [0, 834.3333129882812],         ),       },     ],   }));    return (     &lt;Animated.View       style={[styles.box, {left: generateRandom()}, animatedStyle]}     \/>   ); }; <\/code><\/pre>\n<\/p>\n<\/div>\n<\/details>\n<details class=\"spoiler\">\n<summary>\u041a\u043e\u0434 Animated<\/summary>\n<div class=\"spoiler__content\">\n<pre><code class=\"javascript\">export const NativeAnimatedItem = () => {   const value = useRef(new Animated.Value(0)).current;    useEffect(() => {     Animated.loop(       Animated.sequence([         Animated.timing(value, {           toValue: 834.3333129882812,           useNativeDriver: true,           duration: twoNumRandom(1500, 2000),           easing: Easing.bounce,         }),         Animated.timing(value, {           toValue: 0,           useNativeDriver: true,           duration: twoNumRandom(1500, 2000),           easing: Easing.bounce,         }),       ]),     ).start();   }, []);    const style = useMemo(     () => [       styles.box,       {         left: generateRandom(),         transform: [           {             translateY: value,           },         ],       },     ],     [],   );    return &lt;Animated.View style={style} \/>; };<\/code><\/pre>\n<\/p>\n<\/div>\n<\/details>\n<p>\u041f\u043e\u043b\u0443\u0447\u0430\u0435\u043c \u0432\u043e\u0442 \u0442\u0430\u043a\u043e\u0439 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442:<\/p>\n<figure class=\"full-width\">\n<div><figcaption>\u0421\u043d\u0430\u0447\u0430\u043b\u0430 \u0441\u043c\u043e\u0442\u0440\u0438\u043c \u0430\u043d\u0438\u043c\u0430\u043d\u0438\u044e \u043d\u0430 Animated, \u0437\u0430\u0442\u0435\u043c \u043d\u0430 Reanimated<\/figcaption><\/div>\n<\/figure>\n<div>\n<div class=\"table\">\n<table>\n<tbody>\n<tr>\n<td data-colwidth=\"206\" width=\"206\">\n<p align=\"left\">\n<\/td>\n<td>\n<p align=\"left\"><strong>Animated<\/strong><\/p>\n<\/td>\n<td>\n<p align=\"left\"><strong>Reanimated<\/strong><\/p>\n<\/td>\n<\/tr>\n<tr>\n<td data-colwidth=\"206\" width=\"206\">\n<p align=\"left\"><strong>RAM<\/strong><\/p>\n<\/td>\n<td>\n<p align=\"left\">121<\/p>\n<\/td>\n<td>\n<p align=\"left\">200<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td data-colwidth=\"206\" width=\"206\">\n<p align=\"left\"><strong>CPU(ios)<\/strong><\/p>\n<\/td>\n<td>\n<p align=\"left\">60%<\/p>\n<\/td>\n<td>\n<p align=\"left\">60%<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td data-colwidth=\"206\" width=\"206\">\n<p align=\"left\"><strong>FPS<\/strong><\/p>\n<\/td>\n<td>\n<p align=\"left\">60<\/p>\n<\/td>\n<td>\n<p align=\"left\">60<\/p>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<\/div>\n<p>\u041e\u0431\u0430 \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442\u0430 \u0441\u043f\u0440\u0430\u0432\u0438\u043b\u0438\u0441\u044c \u043d\u0435\u043f\u043b\u043e\u0445\u043e, \u0445\u043e\u0442\u044f \u0432 \u043d\u0430\u0447\u0430\u043b\u0435 \u043f\u0440\u043e\u044f\u0432\u0438\u043b\u0438\u0441\u044c \u043d\u0435\u0431\u043e\u043b\u044c\u0448\u0438\u0435 \u043f\u0440\u043e\u0441\u0430\u0434\u043a\u0438 \u043f\u0440\u0438 \u043f\u043e\u0441\u0442\u0440\u043e\u0435\u043d\u0438\u0438 \u0432\u0438\u0440\u0442\u0443\u0430\u043b\u044c\u043d\u043e\u0433\u043e \u0434\u0435\u0440\u0435\u0432\u0430. \u041e\u0434\u043d\u0430\u043a\u043e \u043f\u0435\u0440\u0444\u043e\u043c\u0430\u043d\u0441 \u043c\u043e\u043d\u0438\u0442\u043e\u0440 \u0441\u0432\u0435\u0440\u0445\u0443 \u043f\u043e\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u0442, \u0447\u0442\u043e Reanimated \u0442\u0440\u0435\u0431\u0443\u0435\u0442\u0441\u044f \u043a\u0430\u043a \u043c\u0438\u043d\u0438\u043c\u0443\u043c \u043d\u0430 60\u043c\u0431 \u0431\u043e\u043b\u044c\u0448\u0435 \u043e\u043f\u0435\u0440\u0430\u0442\u0438\u0432\u043d\u043e\u0439 \u043f\u0430\u043c\u044f\u0442\u0438. <\/p>\n<p>\u041d\u0430\u0433\u0440\u0443\u0437\u043a\u0430 \u043d\u0430 \u0426\u041f \u0432 \u044d\u0442\u043e\u043c \u043a\u0435\u0439\u0441\u0435 \u043e\u0434\u0438\u043d\u0430\u043a\u043e\u0432\u0430\u044f.<\/p>\n<div>\n<div class=\"table\">\n<table>\n<tbody>\n<tr>\n<td colspan=\"2\">\n<p align=\"center\"><strong>\u0420\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u044b \u043f\u0435\u0440\u0432\u043e\u0433\u043e \u044d\u043a\u0441\u043f\u0435\u0440\u0438\u043c\u0435\u043d\u0442\u0430:<\/strong><\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p align=\"left\">\u041f\u043b\u0430\u0432\u043d\u043e\u0441\u0442\u044c \u0430\u043d\u0438\u043c\u0430\u0446\u0438\u0438 (fps)<\/p>\n<\/td>\n<td>\n<p align=\"left\">\u043f\u043e \u043e\u0447\u043a\u0443 Animated \u0438 Reanimated<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p align=\"left\">\u0420\u0430\u0441\u0445\u043e\u0434\u043e\u0432\u0430\u043d\u0438\u0435 \u043f\u0430\u043c\u044f\u0442\u0438<\/p>\n<\/td>\n<td>\n<p align=\"left\">\u043f\u043e\u0431\u0435\u0434\u0438\u043b Animated<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p align=\"left\">\u041d\u0430\u0433\u0440\u0443\u0437\u043a\u0430 \u043d\u0430 \u0426\u041f<\/p>\n<\/td>\n<td>\n<p align=\"left\">\u043f\u043e \u043e\u0447\u043a\u0443 Animated \u0438 Reanimated<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td colspan=\"2\">\n<p align=\"center\"><strong>Animated<\/strong> 3-2 <strong>Reanimated<\/strong><\/p>\n<\/td>\n<\/tr>\n<tr>\n<td colspan=\"2\">\n<p align=\"center\"><strong>\u041f\u0435\u0440\u0432\u044b\u0439 \u0440\u0430\u0443\u043d\u0434 \u0437\u0430 Animated<\/strong><\/p>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<\/div>\n<p><a class=\"anchor\" name=\"12\" id=\"12\"><\/a><\/p>\n<h2>\u042d\u043a\u0441\u043f\u0435\u0440\u0438\u043c\u0435\u043d\u0442 2. \u0414\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u043c scale<\/h2>\n<p>\u0414\u043e\u0431\u0430\u0432\u0438\u043c \u0430\u043d\u0438\u043c\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u043e\u0435 \u0441\u0432\u043e\u0439\u0441\u0442\u0432\u043e scale. \u041f\u043e\u0441\u043c\u043e\u0442\u0440\u0438\u043c, \u043a\u0430\u043a \u0431\u0443\u0434\u0435\u0442 \u0432\u043b\u0438\u044f\u0442\u044c \u043d\u0430 \u043f\u0435\u0440\u0444\u043e\u043c\u0430\u043d\u0441 \u043d\u0430\u043b\u0438\u0447\u0438\u0435 \u0431\u043e\u043b\u044c\u0448\u0435 \u0447\u0435\u043c \u043e\u0434\u043d\u043e\u0433\u043e \u0441\u0432\u043e\u0439\u0441\u0442\u0432\u0430.<\/p>\n<details class=\"spoiler\">\n<summary>\u041a\u043e\u0434 Animated<\/summary>\n<div class=\"spoiler__content\">\n<pre><code class=\"javascript\">export const NativeAnimatedItem = () => {   const value = useRef(new Animated.Value(0)).current;   const scallableValue = useRef(new Animated.Value(0)).current;    useEffect(() => {     Animated.loop(       Animated.sequence([         Animated.timing(scallableValue, {           toValue: twoNumRandom(0.85, 0.95),           useNativeDriver: true,           easing: Easing.bounce,         }),         Animated.timing(scallableValue, {           toValue: twoNumRandom(2.6, 3),           useNativeDriver: true,           easing: Easing.bounce,         }),       ]),     ).start();      Animated.loop(       Animated.sequence([         Animated.timing(value, {           toValue: 834.3333129882812,           useNativeDriver: true,           duration: twoNumRandom(1500, 2000),           easing: Easing.bounce,         }),         Animated.timing(value, {           toValue: 0,           useNativeDriver: true,           duration: twoNumRandom(1500, 2000),           easing: Easing.bounce,         }),       ]),     ).start();   }, []);    const style = useMemo(     () => [       styles.box,       {         left: generateRandom(),         transform: [           {             translateY: value,           },           {scale: scallableValue},         ],       },     ],     [],   );    return &lt;Animated.View style={style} \/>; };<\/code><\/pre>\n<\/p>\n<\/div>\n<\/details>\n<details class=\"spoiler\">\n<summary>\u041a\u043e\u0434 Reanimated<\/summary>\n<div class=\"spoiler__content\">\n<pre><code class=\"javascript\">export const ReanimatedAnimatedItem = () => {   const scallableValue = useDerivedValue(() =>     withRepeat(       withSequence(         withTiming(twoNumRandom(0.85, 0.95)),         withTiming(twoNumRandom(2.6, 3)),       ),       -1,       true,     ),   );    const animation = useDerivedValue(() =>     withRepeat(       withSequence(         withTiming(0, {           duration: twoNumRandom(1500, 2000),           easing: Easing.bounce,         }),         withTiming(1, {           duration: twoNumRandom(1500, 2000),           easing: Easing.bounce,         }),       ),       -1,       true,     ),   );    const animatedStyle = useAnimatedStyle(() => ({     transform: [       {         translateY: interpolate(           animation.value,           [0, 1],           [0, 834.3333129882812],         ),       },       {         scale: scallableValue.value,       },     ],   }));    return (     &lt;Animated.View       style={[styles.box, {left: generateRandom()}, animatedStyle]}     \/>   ); }; <\/code><\/pre>\n<\/p>\n<\/div>\n<\/details>\n<figure class=\"full-width\"><\/figure>\n<div>\n<div class=\"table\">\n<table>\n<tbody>\n<tr>\n<td data-colwidth=\"206\" width=\"206\"><\/td>\n<td data-colwidth=\"248\" width=\"248\">\n<p align=\"left\"><strong>Animated<\/strong><\/p>\n<\/td>\n<td>\n<p align=\"left\"><strong>Reanimated<\/strong><\/p>\n<\/td>\n<\/tr>\n<tr>\n<td data-colwidth=\"206\" width=\"206\">\n<p align=\"left\"><strong>RAM<\/strong><\/p>\n<\/td>\n<td data-colwidth=\"248\" width=\"248\">\n<p align=\"left\">140<\/p>\n<\/td>\n<td>\n<p align=\"left\">240<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td data-colwidth=\"206\" width=\"206\">\n<p align=\"left\"><strong>CPU(iOS)<\/strong><\/p>\n<\/td>\n<td data-colwidth=\"248\" width=\"248\">\n<p align=\"left\">181%<\/p>\n<\/td>\n<td>\n<p align=\"left\">85%<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td data-colwidth=\"206\" width=\"206\">\n<p align=\"left\"><strong>FPS<\/strong><\/p>\n<\/td>\n<td data-colwidth=\"248\" width=\"248\">\n<p align=\"left\">2 (JS-\u043f\u043e\u0442\u043e\u043a)<\/p>\n<\/td>\n<td>\n<p align=\"left\">60<\/p>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<\/div>\n<p>useNativeDriver \u043d\u0435 \u0441\u043f\u0440\u0430\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0441 \u043d\u0430\u0433\u0440\u0443\u0437\u043a\u043e\u0439, \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u043f\u0440\u043e\u0441\u0435\u043b\u043e \u0434\u043e 1 \u043a\u0430\u0434\u0440\u0430 \u0432 \u0441\u0435\u043a\u0443\u043d\u0434\u0443. \u0410 \u0432\u043e\u0442 Reanimated \u043f\u043e\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u0442 \u0442\u0435 \u0436\u0435 \u0441\u0442\u0430\u0431\u0438\u043b\u044c\u043d\u044b\u0435 60 fps.\u00a0<\/p>\n<p>\u041d\u0430\u0433\u0440\u0443\u0437\u043a\u0430 \u043d\u0430 \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u043e\u0440 \u0443 Reanimated \u043d\u0438\u0436\u0435 \u0447\u0435\u043c \u0443 useNativeDriver,\u00a0\u043d\u043e \u043e\u043f\u0435\u0440\u0430\u0442\u0438\u0432\u043d\u043e\u0439 \u043f\u0430\u043c\u044f\u0442\u0438 \u0440\u0430\u0441\u0445\u043e\u0434\u0443\u0435\u0442\u0441\u044f \u043d\u0430 100 \u043c\u0431 \u0431\u043e\u043b\u044c\u0448\u0435. \u0422\u0430\u043a\u0436\u0435, \u043f\u043e\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u043d\u0430 \u043f\u0435\u0440\u0444\u043e\u043c\u0430\u043d\u0441 \u043c\u043e\u043d\u0438\u0442\u043e\u0440 \u0432 Android Studio.<\/p>\n<figure class=\"full-width\">\n<div><figcaption>Perfomance \u043c\u043e\u043d\u0438\u0442\u043e\u0440 \u0432 android studio<\/figcaption><\/div>\n<\/figure>\n<p>\u0414\u043b\u044f \u043d\u0430\u0433\u043b\u044f\u0434\u043d\u043e\u0441\u0442\u0438 \u0441\u0440\u0430\u0432\u043d\u0438\u043c \u0440\u0430\u0441\u0445\u043e\u0434 \u043e\u043f\u0435\u0440\u0430\u0442\u0438\u0432\u043d\u043e\u0439 \u043f\u0430\u043c\u044f\u0442\u0438 \u0432 \u043a\u0435\u0439\u0441\u0435 \u0441 \u0448\u0430\u0440\u0438\u043a\u0430\u043c\u0438 \u043d\u0430 \u0440\u0430\u0437\u043d\u043e\u043c \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u0435 \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u043e\u0432.<\/p>\n<figure class=\"full-width\"><\/figure>\n<p>\u0421\u0443\u0449\u0435\u0441\u0442\u0432\u0435\u043d\u043d\u0430\u044f \u0440\u0430\u0437\u043d\u0438\u0446\u0430 \u0437\u0430\u043c\u0435\u0442\u043d\u0430 \u043b\u0438\u0448\u044c \u043d\u0430 1000 \u043d\u043e\u0434\u0430\u0445 \u0438 \u0432\u044b\u0448\u0435. \u041d\u043e \u0432 \u0440\u0435\u0430\u043b\u044c\u043d\u043e\u0441\u0442\u0438 \u0431\u043e\u043b\u044c\u0448\u0435 \u0447\u0435\u043c 100 \u0430\u043d\u0438\u043c\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0445 \u043d\u043e\u0434 \u0432\u0441\u0442\u0440\u0435\u0442\u0438\u0442\u044c \u0442\u044f\u0436\u0435\u043b\u043e. \u0412 \u0440\u0430\u043c\u043a\u0430\u0445 \u044d\u043a\u0441\u043f\u0435\u0440\u0438\u043c\u0435\u043d\u0442\u0430 Reanimated \u0431\u0435\u0440\u0451\u0442 \u0432\u0435\u0440\u0445, \u043d\u043e \u0437\u0430\u043f\u043e\u043c\u043d\u0438\u043c, \u0447\u0442\u043e \u043f\u0440\u0435\u0438\u043c\u0443\u0449\u0435\u0441\u0442\u0432\u043e \u0437\u0434\u0435\u0441\u044c \u0432\u0435\u0441\u044c\u043c\u0430 \u0443\u043c\u043e\u0437\u0440\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0435.<\/p>\n<div>\n<div class=\"table\">\n<table>\n<tbody>\n<tr>\n<td colspan=\"2\">\n<p align=\"center\"><strong>\u0420\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u044b \u044d\u043a\u0441\u043f\u0435\u0440\u0438\u043c\u0435\u043d\u0442\u0430:<\/strong><\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p align=\"left\">\u041f\u043b\u0430\u0432\u043d\u043e\u0441\u0442\u044c \u0430\u043d\u0438\u043c\u0430\u0446\u0438\u0438 (fps)<\/p>\n<\/td>\n<td>\n<p align=\"left\">\u043f\u043e\u0431\u0435\u0434\u0438\u043b Reanimated<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p align=\"left\">\u0420\u0430\u0441\u0445\u043e\u0434\u043e\u0432\u0430\u043d\u0438\u0435 \u043f\u0430\u043c\u044f\u0442\u0438<\/p>\n<\/td>\n<td>\n<p align=\"left\">\u043f\u043e\u0431\u0435\u0434\u0438\u043b Animated<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p align=\"left\">\u041d\u0430\u0433\u0443\u0437\u043a\u0430 \u043d\u0430 \u0426\u041f<\/p>\n<\/td>\n<td>\n<p align=\"left\">\u043f\u043e\u0431\u0435\u0434\u0438\u043b Reanimated<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td colspan=\"2\">\n<p align=\"center\"><strong>Animated<\/strong> 1-2 <strong>Reanimated<\/strong><\/p>\n<\/td>\n<\/tr>\n<tr>\n<td colspan=\"2\">\n<p align=\"center\"><strong>\u0412\u0442\u043e\u0440\u043e\u0439 \u0440\u0430\u0443\u043d\u0434 \u0437\u0430 Reanimated<\/strong><\/p>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<\/div>\n<h3>\u041f\u043e\u0447\u0435\u043c\u0443 \u0442\u0430\u043a \u043f\u0440\u043e\u0438\u0437\u043e\u0448\u043b\u043e?<\/h3>\n<p>\u0414\u0430\u0432\u0430\u0439\u0442\u0435 \u0440\u0430\u0437\u0431\u0438\u0440\u0430\u0442\u044c\u0441\u044f, \u043f\u043e\u0447\u0435\u043c\u0443 \u044d\u043a\u0441\u043f\u0435\u0440\u0438\u043c\u0435\u043d\u0442 1 \u0438 2 \u0434\u0430\u043b\u0438 \u0440\u0430\u0437\u043d\u044b\u0435 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u044b. <\/p>\n<p>\u041d\u0435 \u0432\u0441\u0435 \u043c\u0435\u0442\u043e\u0434\u044b \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u044e\u0442 useNativeDriver. \u0412\u043c\u0435\u0441\u0442\u043e \u044d\u0442\u043e\u0433\u043e \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0430\u0435\u0442\u0441\u044f requestAnimationFrame. Event.start() \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0435\u0442\u0441\u044f \u0432 \u043d\u0430\u0442\u0438\u0432\u043a\u0435, \u0430 \u0432\u043e\u0442 \u043e\u0441\u0442\u0430\u043b\u044c\u043d\u044b\u0435 \u043c\u0435\u0442\u043e\u0434\u044b \u0442\u0440\u0435\u0431\u0443\u044e\u0442 \u043b\u0438\u0448\u043d\u0438\u0439 \u0440\u0430\u0437 \u043f\u0435\u0440\u0435\u0433\u043d\u0430\u0442\u044c \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u0432 JS-\u043f\u043e\u0442\u043e\u043a\u0435. <\/p>\n<p>\u0412 \u0434\u0430\u043d\u043d\u043e\u043c \u043f\u0440\u0438\u043c\u0435\u0440\u0435 \u043c\u044b \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c Sequence \u0434\u043b\u044f \u043e\u0431\u044a\u0435\u0434\u0438\u043d\u0435\u043d\u0438\u044f \u0430\u043d\u0438\u043c\u0430\u0446\u0438\u0439 \u0432 \u0446\u0435\u043f\u043e\u0447\u043a\u0443. \u0418\u0437-\u0437\u0430 \u044d\u0442\u043e\u0433\u043e fps \u043f\u0430\u0434\u0430\u0435\u0442. \u0415\u0441\u043b\u0438 \u0443\u0431\u0440\u0430\u0442\u044c Sequence, \u0442\u043e useNativeDriver \u0431\u0443\u0434\u0435\u0442 \u0432\u043a\u043b\u044e\u0447\u0435\u043d \u0438 \u0430\u043d\u0438\u043c\u0430\u0446\u0438\u0438 \u0441\u0442\u0430\u043d\u0443\u0442 \u0431\u043e\u043b\u0435\u0435 \u043f\u043b\u0430\u0432\u043d\u044b\u043c\u0438.<\/p>\n<p>\u0412 \u0441\u043b\u0443\u0447\u0430\u0435 \u0441 Reanimated \u043e\u0431\u0449\u0435\u043d\u0438\u0435 \u043f\u0440\u043e\u0438\u0441\u0445\u043e\u0434\u0438\u0442 \u0447\u0435\u0440\u0435\u0437 JSI, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 JS-\u043f\u043e\u0442\u043e\u043a \u043d\u0435 \u043f\u0435\u0440\u0435\u0433\u0440\u0443\u0436\u0430\u0435\u0442\u0441\u044f. <\/p>\n<p>\u0414\u0430\u0432\u0430\u0439\u0442\u0435 \u043f\u043e\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u0432 \u043b\u043e\u0433\u0438 \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e MessageQueue \u0434\u043b\u044f \u0431\u043e\u043b\u044c\u0448\u0435\u0433\u043e \u043f\u043e\u043d\u0438\u043c\u0430\u043d\u0438\u044f \u0442\u043e\u0433\u043e \u0447\u0442\u043e \u043f\u0440\u043e\u0438\u0441\u0445\u043e\u0434\u0438\u0442 \u043f\u043e\u0434 \u043a\u0430\u043f\u043e\u0442\u043e\u043c:<\/p>\n<figure class=\"full-width\">\n<div><figcaption>\u0415\u0441\u043b\u0438 \u043a\u043b\u0438\u043a\u043d\u0443\u0442\u044c \u043d\u0430 \u043a\u0430\u0440\u0442\u0438\u043d\u043a\u0443, \u0431\u0443\u0434\u0435\u0442 \u043f\u0440\u043e\u0449\u0435 \u043f\u0440\u043e\u0447\u0438\u0442\u0430\u0442\u044c \ud83d\ude42<\/figcaption><\/div>\n<\/figure>\n<p>\u0412 Reanimated \u0441\u043e\u0437\u0434\u0430\u0435\u0442\u0441\u044f \u0442\u0430\u0439\u043c\u0435\u0440 \u0434\u043b\u044f \u0430\u043d\u0438\u043c\u0430\u0446\u0438\u0438 \u0438 \u0441\u0430\u043c\u0430 \u043d\u043e\u0434\u0430. \u041d\u0438\u043a\u0430\u043a\u0438\u0445 \u043b\u0438\u0448\u043d\u0438\u0445 \u0432\u044b\u0437\u043e\u0432\u043e\u0432 \u043d\u0435 \u0432\u0438\u0434\u0438\u043c. Animated + useNativeDriver \u0434\u0435\u043b\u0430\u0435\u0442 \u0442\u043e \u0436\u0435 \u0441\u0430\u043c\u043e\u0435, \u043d\u043e \u0435\u0449\u0451 \u043a\u0430\u0436\u0434\u044b\u0439 \u0440\u0430\u0437 \u0434\u0435\u043b\u0430\u0435\u0442 \u0432\u044b\u0437\u043e\u0432\u044b \u043d\u0430 \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u0435 \u0430\u043d\u0438\u043c\u0430\u0446\u0438\u0438 \u0432 JS-\u043f\u043e\u0442\u043e\u043a\u0435.<\/p>\n<p><a class=\"anchor\" name=\"2\" id=\"2\"><\/a><\/p>\n<h2>\u042d\u043a\u0441\u043f\u0435\u0440\u0438\u043c\u0435\u043d\u0442 3. \u0410\u043d\u0438\u043c\u0430\u0446\u0438\u044f, \u043f\u0440\u0438\u0432\u044f\u0437\u0430\u043d\u043d\u0430\u044f \u043a \u0441\u043a\u0440\u043e\u043b\u043b\u0443<\/h2>\n<p>\u041f\u043e\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u043d\u0430 \u0434\u0440\u0443\u0433\u043e\u0439 \u0432\u0438\u0434 \u0430\u043d\u0438\u043c\u0430\u0446\u0438\u0438 \u2014\u00a0\u043f\u0440\u0438\u0432\u044f\u0437\u0430\u043d\u043d\u044b\u0439 \u043a \u0441\u043a\u0440\u043e\u043b\u043b\u0443. \u0414\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u0443 Animated \u0435\u0441\u0442\u044c \u043c\u0435\u0442\u043e\u0434 <strong>Event<\/strong> \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0441\u043e\u0437\u0434\u0430\u0435\u0442 \u043a\u0430\u0440\u0442\u0443 \u0430\u043d\u0438\u043c\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0445 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0439. \u0410 \u0432 \u0441\u043b\u0443\u0447\u0430\u0435 \u0441 Reanimated \u0441\u043e\u0437\u0434\u0430\u0434\u0438\u043c <strong>shared value<\/strong> \u0434\u043b\u044f \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u0438\u044f \u043f\u043e\u0437\u0438\u0446\u0438\u0438 \u0441\u043a\u0440\u043e\u043b\u043b\u0430. \u0410\u043d\u0438\u043c\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0431\u0443\u0434\u0435\u043c <strong>Lottie <\/strong>\u0430\u043d\u0438\u043c\u0430\u0446\u0438\u044e.<\/p>\n<blockquote>\n<p><em>\u041e\u0431\u0437\u043e\u0440 \u043d\u0430 \u0440\u0430\u0437\u043d\u044b\u0435 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043c\u043e\u0436\u043d\u043e \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0438\u0442\u044c \u043a Reanimated \u043c\u043e\u0436\u043d\u043e \u043f\u0440\u043e\u0447\u0438\u0442\u0430\u0442\u044c \u0435\u0449\u0451 \u0432 \u043e\u0434\u043d\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0435 \u0416\u0435\u043d\u0438: <\/em><a href=\"https:\/\/habr.com\/ru\/companies\/sbermarket\/articles\/725042\/\"><em><u>\u042d\u0444\u0444\u0435\u043a\u0442\u043d\u043e \u0438 \u044d\u0444\u0444\u0435\u043a\u0442\u0438\u0432\u043d\u043e. 6 \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442\u043e\u0432 \u0434\u043b\u044f \u0430\u043d\u0438\u043c\u0430\u0446\u0438\u0438 \u0432 React Native<\/u><\/em><\/a><\/p>\n<\/blockquote>\n<details class=\"spoiler\">\n<summary>\u041a\u043e\u0434 Reanimated<\/summary>\n<div class=\"spoiler__content\">\n<pre><code class=\"javascript\">export const CompareWithScroll = () => {   const scrollY = useSharedValue(0);    return (     &lt;Animated.ScrollView       style={{flex: 1, backgroundColor: '#fff'}}       onScroll={event => {         scrollY.value = event.nativeEvent.contentOffset.y;       }}       scrollEventThrottle={16}>       {new Array(100).fill(0).map(() => (         &lt;LottieReanimated source={lottie} scrollY={scrollY} \/>       ))}     &lt;\/Animated.ScrollView>   ); };  export const LottieReanimated = ({source, scrollY}: Props) => {   const animatedProps = useAnimatedProps(() => ({     progress: interpolate(-scrollY.value, [0, height], [0, 1]), <\/code><\/pre>\n<\/div>\n<\/details>\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-356635","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/356635","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=356635"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/356635\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=356635"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=356635"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=356635"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}