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


React Telegram | DID YOU KNOW?

Date: |

How to Invest in Bitcoin?

Like a stock, you can buy and hold Bitcoin as an investment. You can even now do so in special retirement accounts called Bitcoin IRAs. No matter where you choose to hold your Bitcoin, people’s philosophies on how to invest it vary: Some buy and hold long term, some buy and aim to sell after a price rally, and others bet on its price decreasing. Bitcoin’s price over time has experienced big price swings, going as low as $5,165 and as high as $28,990 in 2020 alone. “I think in some places, people might be using Bitcoin to pay for things, but the truth is that it’s an asset that looks like it’s going to be increasing in value relatively quickly for some time,” Marquez says. “So why would you sell something that’s going to be worth so much more next year than it is today? The majority of people that hold it are long-term investors.”

What Is Bitcoin?

Bitcoin is a decentralized digital currency that you can buy, sell and exchange directly, without an intermediary like a bank. Bitcoin’s creator, Satoshi Nakamoto, originally described the need for “an electronic payment system based on cryptographic proof instead of trust.” Each and every Bitcoin transaction that’s ever been made exists on a public ledger accessible to everyone, making transactions hard to reverse and difficult to fake. That’s by design: Core to their decentralized nature, Bitcoins aren’t backed by the government or any issuing institution, and there’s nothing to guarantee their value besides the proof baked in the heart of the system. “The reason why it’s worth money is simply because we, as people, decided it has value—same as gold,” says Anton Mozgovoy, co-founder & CEO of digital financial service company Holyheld.

React from ye


Telegram React
FROM USA