From 49f25dabb544a714476d6663f00fa3d3e2d77ca4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Patryk=20K=C5=82osi=C5=84ski?= Date: Tue, 7 Jan 2025 22:17:33 +0100 Subject: [PATCH] bug: Update particles MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Cache component to prevent refreshing Refs: 86936x35u Signed-off-by: Patryk Kłosiński --- .../Features/Login/components/ParticleBg/ParticleBg.tsx | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/frontend/src/Features/Login/components/ParticleBg/ParticleBg.tsx b/frontend/src/Features/Login/components/ParticleBg/ParticleBg.tsx index 4b13b25..d34ffc3 100644 --- a/frontend/src/Features/Login/components/ParticleBg/ParticleBg.tsx +++ b/frontend/src/Features/Login/components/ParticleBg/ParticleBg.tsx @@ -1,4 +1,4 @@ -import {useEffect} from "react"; +import React, {useEffect} from "react"; import {loadFull} from "tsparticles"; import {useColorScheme} from "@mantine/hooks"; import type {Container, Engine, IOptions} from "@tsparticles/engine"; @@ -6,7 +6,7 @@ import Particles, {initParticlesEngine} from "@tsparticles/react"; import kitty_light from "./assets/kitty_light.svg"; import kitty_dark from "./assets/kitty_dark.svg"; -export const ParticleBg = () => { +export const ParticleBg = React.memo(() => { const colorScheme = useColorScheme(); useEffect(() => { @@ -109,10 +109,9 @@ export const ParticleBg = () => { detectRetina: true, }; - const particlesLoaded = async (container: Container | undefined) => { console.log(container); }; return ; -}; +});