Telegram Group & Telegram Channel
🔥 Сегодня покажу, как настроить мгновенное обновление компонентов в React без полной перезагрузки страницы

Если ты пользуешься Vite, Parcel или Webpack с React — тебе точно стоит включить React Fast Refresh. Это технология, которая сохраняет состояние компонентов при обновлении кода. Раньше нужно было каждый раз обновлять страницу и терять всё введённое. Теперь — нет!

⚙️ Как это работает?

React Fast Refresh отслеживает изменения в компонентах и аккуратно обновляет только изменившиеся части DOM. Всё состояние (useState, useReducer, useRef) остаётся.

Как включить в Vite:

Установи плагин:


npm install --save-dev @vitejs/plugin-react


И подключи в vite.config.ts:


import react from '@vitejs/plugin-react';

export default defineConfig({
plugins: [react()],
});


Этот плагин включает react-refresh автоматически под капотом.

🤯 Что получаешь:

* мгновенное обновление UI при изменении кода
* сохранение состояния формы, вкладок, фильтров и т.д.
* больше удовольствия от разработки 😎


🎯 Не забудь, это работает только в dev-режиме. В проде всё остаётся стабильным и оптимизированным.

✍️ @React_lib



tg-me.com/React_lib/678
Create:
Last Update:

🔥 Сегодня покажу, как настроить мгновенное обновление компонентов в React без полной перезагрузки страницы

Если ты пользуешься Vite, Parcel или Webpack с React — тебе точно стоит включить React Fast Refresh. Это технология, которая сохраняет состояние компонентов при обновлении кода. Раньше нужно было каждый раз обновлять страницу и терять всё введённое. Теперь — нет!

⚙️ Как это работает?

React Fast Refresh отслеживает изменения в компонентах и аккуратно обновляет только изменившиеся части DOM. Всё состояние (useState, useReducer, useRef) остаётся.

Как включить в Vite:

Установи плагин:


npm install --save-dev @vitejs/plugin-react


И подключи в vite.config.ts:


import react from '@vitejs/plugin-react';

export default defineConfig({
plugins: [react()],
});


Этот плагин включает react-refresh автоматически под капотом.

🤯 Что получаешь:

* мгновенное обновление UI при изменении кода
* сохранение состояния формы, вкладок, фильтров и т.д.
* больше удовольствия от разработки 😎


🎯 Не забудь, это работает только в dev-режиме. В проде всё остаётся стабильным и оптимизированным.

✍️ @React_lib

BY React




Share with your friend now:
tg-me.com/React_lib/678

View MORE
Open in Telegram


telegram Telegram | DID YOU KNOW?

Date: |

How Does Bitcoin Work?

Bitcoin is built on a distributed digital record called a blockchain. As the name implies, blockchain is a linked body of data, made up of units called blocks that contain information about each and every transaction, including date and time, total value, buyer and seller, and a unique identifying code for each exchange. Entries are strung together in chronological order, creating a digital chain of blocks. “Once a block is added to the blockchain, it becomes accessible to anyone who wishes to view it, acting as a public ledger of cryptocurrency transactions,” says Stacey Harris, consultant for Pelicoin, a network of cryptocurrency ATMs. Blockchain is decentralized, which means it’s not controlled by any one organization. “It’s like a Google Doc that anyone can work on,” says Buchi Okoro, CEO and co-founder of African cryptocurrency exchange Quidax. “Nobody owns it, but anyone who has a link can contribute to it. And as different people update it, your copy also gets updated.”

How Does Telegram Make Money?

Telegram is a free app and runs on donations. According to a blog on the telegram: We believe in fast and secure messaging that is also 100% free. Pavel Durov, who shares our vision, supplied Telegram with a generous donation, so we have quite enough money for the time being. If Telegram runs out, we will introduce non-essential paid options to support the infrastructure and finance developer salaries. But making profits will never be an end-goal for Telegram.

telegram from ms


Telegram React
FROM USA