React JS
React программирование @haarrp - admin @itchannels_telegram - 🔥лучшие ит-каналы @javascriptv - продвинутый javascript @programming_books_it - бесплатные it книги @ai_machinelearning_big_data - ml № 5037566384
Show more📈 Analytical overview of Telegram channel React JS
Channel React JS (@react_tg) in the Russian language segment is an active participant. Currently, the community unites 16 707 subscribers, ranking 7 924 in the Technologies & Applications category and 40 283 in the Russia region.
📊 Audience metrics and dynamics
Since its creation on невідомо, the project has demonstrated rapid growth, gathering an audience of 16 707 subscribers.
According to the latest data from 13 June, 2026, the channel demonstrates stable activity. Although there has been a change in the number of participants by -160 over the last 30 days and by -3 over the last 24 hours, overall reach remains high.
- Verification status: Not verified
- Engagement rate (ER): The average audience engagement rate is 15.00%. Within the first 24 hours after publication, content typically collects 6.14% reactions from the total number of subscribers.
- Post reach: On average, each post receives 2 507 views. Within the first day, a publication typically gains 1 026 views.
- Reactions and interaction: The audience actively supports content: the average number of reactions per post is 14.
- Thematic interests: Content is focused on key topics such as javascript, github, css, интерфейс, браузер.
📝 Description and content policy
The author describes the resource as a platform for expressing subjective opinions:
“React программирование
@haarrp - admin
@itchannels_telegram - 🔥лучшие ит-каналы
@javascriptv - продвинутый javascript
@programming_books_it - бесплатные it книги
@ai_machinelearning_big_data - ml
№ 5037566384”
Thanks to the high frequency of updates (latest data received on 14 June, 2026), the channel maintains relevance and a high level of publication reach. Analytics show that the audience actively interacts with content, making it an important point of influence in the Technologies & Applications category.
Нативная интеграция. Информация о продукте www.otus.ruconst useMount = (callback) => {
React.useEffect(callback, [])
}
Пример:
const UseMountDemo = () => {
const [count, setCount] = React.useState(0)
useMount(() => {
console.log("useMount")
})
return (
<div>
count: { count }
<button onClick={() => setCount(count++)}>add</button>
</div>
)
}
Когда компонент рендерится повторно, useMount не выполняется снова.
2. useUnmount
Можно разработать хук useUnmount, чтобы указать, что функция обратного вызова выполняется, когда компонент размонтирован.
Исходный код:
const useUnmount = (callback) => {
React.useEffect(() => {
return callback
}, [])
}
Пример:
const Child = () => {
const [ count, setCount ] = useState(0)
useUnmount(() => {
// Мы ожидаем вывод значения num, когда компонент будет размонтирован
console.log('useUnmount', count)
})
return (
<div>
count: {count}
<button onClick={() => setCount(count + 1)}>add</button>
</div>
)
}
const UseUnmountedDemo = () => {
const [showChild, setShowChild] = React.useState(true);
// Мы используем "showChild" для управления отображением и скрытием дочернего компонента
return (
<div>
{ !!showChild && <Child /> }
<button onClick={() => setShowChild(false)}>Destroy child</button>
</div>
)
}
Когда компонент Child удаляется, функция обратного вызова useUnmount выполняется, но обнаруживается, что count — это начальное значение 0, а не 10. Что вызывает такой неправильный результат?
Причина этого кроется в механизме закрытия в useEffect, потому что функция передается при выгрузке компонента для первого рендеринга. Чтобы получить состояние в реальном времени, нужно использовать useRef.
const useUnmount = (callback) => {
const callbackRef = React.useRef(callback)
callbackRef.current = callback
React.useEffect(() => {
return () => {
callbackRef.current()
}
}, [])
}
Теперь при удалении компонента получаем правильное значение count
3. useContext
Иногда необходимо выполнять логический код только после изменения зависимости. Можно ли мы достичь этой цели, используя такой подход?
function UseUpdateEffectDemo() {
const [count, setCount] = React.useState(0)
React.useEffect(() => {
console.log('count changed', count)
}, [ count ])
return (
<div>
count: {count}
<button onClick={() => setCount(count + 1)}>change</button>
</div>
)
}
Однако count выведет 0, как только компонент будет смонтирован. Как можно выполнить функцию обратного вызова после изменения count?
const useUpdateEffect = function (effectCallback, deps = []) {
const isFirstMount = React.useRef(false)
React.useEffect(() => {
return () => {
isFirstMount.current = false
}
}, [])
React.useEffect(() => {
// Не выполняйте effectcallback для первого раза
if (!isFirstMount.current) {
isFirstMount.current = true
} else {
return effectCallback()
}
}, deps)
}
function UseUpdateEffectDemo() {
const [count, setCount] = React.useState(0)
useUpdateEffect(() => {
console.log('Count changed', count)
}, [ count ])
return (
<div>
count: {count}
<button onClick={() => setCount(count + 1)}>change</button>
</div>
)
}
4. useSetState
Читать продолжениеУрок пройдет в рамках онлайн-курса OTUS “JavaScript QA Engineer”. После занятия полный курс можно приобрести удобным для вас способом.👉 Готовьте вопросы и записывайтесь на вебинар! РЕГИСТРАЦИЯ — https://otus.pw/tf74/
Нативная интеграция. Информация о продукте www.otus.ruimport React, { memo } from 'react'
interface Props {
title: string
subtitle: string
}
const MyComponent: React.FC<Props> = memo(({ title, subtitle }) => {
return (
<div>
<h1>{title}</h1>
<h2>{subtitle}</h2>
</div>
)
})
2. Оптимизация обработчиков событий с помощью useCallback
import React, { useState, useCallback } from 'react'
const Counter: React.FC = () => {
const [count, setCount] = useState(0) const increment = useCallback(() => {
setCount(prevCount => prevCount + 1)
}, [])
return (
<div>
<p>Count: {count}</p>
<button onClick={increment}>Increment</button>
</div>
)
}
3. Виртуализация длинных списков с помощью react-window
import React from 'react'
import { FixedSizeList as List } from 'react-window'
const Row: React.FC<{ index: number; style: React.CSSProperties }> = ({
index,
style,
}) => {
return (
<div style={style}>
<p>{`Row ${index}`}</p>
</div>
)
}
const VirtualizedList: React.FC = () => {
const itemCount = 1000
return (
<List height={500} itemCount={itemCount} itemSize={50} width={300}>
{Row}
</List>
)
}
4. Ленивая загрузка компонентов с помощью React.lazy и Suspense
import React, { lazy, Suspense } from 'react'
const LazyLoadedComponent = lazy(() => import('./LazyLoadedComponent'))
const App: React.FC = () => {
return (
<div>
<Suspense fallback={<div>Loading...</div>}>
<LazyLoadedComponent />
</Suspense>
</div>
)
}
5. Использование API React.Profiler для выявления узких мест производительности
import React, { Profiler } from 'react'
const onRender = (
id: string,
phase: 'mount' | 'update',
actualDuration: number,
baseDuration: number,
startTime: number,
commitTime: number,
interactions: Set<{ id: number; name: string; timestamp: number }>
) => {
console.log('Profiler:', {
id,
phase,
actualDuration,
baseDuration,
startTime,
commitTime,
interactions,
})
}
const App: React.FC = () => {
return (
<Profiler id="MyComponent" onRender={onRender}>
<MyComponent />
</Profiler>
)
}
6. Оптимизация обновления состояний с помощью Immer
import React, { useState } from 'react'
import produce from 'immer'
interface User {
id: number
name: string
}
const App: React.FC = () => {
const [users, setUsers] = useState<User[]>([
{ id: 1, name: 'Alice' },
{ id: 2, name: 'Bob' },
])
const updateUser = (id: number, newName: string) => {
setUsers(
produce((draftUsers: User[]) => {
const user = draftUsers.find(user => user.id === id)
if (user) {
user.name = newName
}
})
)
}
return (
// ...
)
}
7. Использование троттлинга и дебаунсинга для обработчиков ввода
import React, { useState, useCallback } from 'react'
import { debounce } from 'lodash-es'
const SearchBox: React.FC = () => {
const [searchTerm, setSearchTerm] = useState('')
const handleSearch = useCallback(
debounce((value: string) => {
setSearchTerm(value)
}, 300),
[]
)
const handleChange = (event: React.ChangeEvent<HTMLInputElement>) => {
handleSearch(event.target.value)
}
return (
<div>
<input type="text" onChange={handleChange} />
</div>
)
}
@react_tg
Available now! Telegram Research 2025 — the year's key insights 
