🚀Как избавиться от "тряски" компонентов при переключении страниц в React?
Сегодня хочу показать вам простой способ, как сделать ваш интерфейс более плавным при навигации между страницами.
Вы замечали, что при переходе между роутами компоненты "мигают" или резко перерисовываются? Особенно это бросается в глаза, когда вы используете React Router и на каждой новой странице заново монтируются одни и те же элементы (например, хедер или футер).
Решение — layout routes
React Router предлагает отличный способ: использовать layout routes. Это позволяет сохранять общие компоненты между страницами без их размонтирования.
Вот пример:
// Layout.jsx import { Outlet } from "react-router-dom";
// App.jsx import { Routes, Route } from "react-router-dom"; import Layout from "./Layout"; import Home from "./pages/Home"; import About from "./pages/About";
🚀Как избавиться от "тряски" компонентов при переключении страниц в React?
Сегодня хочу показать вам простой способ, как сделать ваш интерфейс более плавным при навигации между страницами.
Вы замечали, что при переходе между роутами компоненты "мигают" или резко перерисовываются? Особенно это бросается в глаза, когда вы используете React Router и на каждой новой странице заново монтируются одни и те же элементы (например, хедер или футер).
Решение — layout routes
React Router предлагает отличный способ: использовать layout routes. Это позволяет сохранять общие компоненты между страницами без их размонтирования.
Вот пример:
// Layout.jsx import { Outlet } from "react-router-dom";
// App.jsx import { Routes, Route } from "react-router-dom"; import Layout from "./Layout"; import Home from "./pages/Home"; import About from "./pages/About";
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.
Telegram Auto-Delete Messages in Any Chat
Some messages aren’t supposed to last forever. There are some Telegram groups and conversations where it’s best if messages are automatically deleted in a day or a week. Here’s how to auto-delete messages in any Telegram chat. You can enable the auto-delete feature on a per-chat basis. It works for both one-on-one conversations and group chats. Previously, you needed to use the Secret Chat feature to automatically delete messages after a set time. At the time of writing, you can choose to automatically delete messages after a day or a week. Telegram starts the timer once they are sent, not after they are read. This won’t affect the messages that were sent before enabling the feature.