Skip to content

Commit

Permalink
bug: Update particles
Browse files Browse the repository at this point in the history
- Cache component to prevent refreshing

Refs: 86936x35u
Signed-off-by: Patryk Kłosiński <[email protected]>
  • Loading branch information
JimTheCat committed Jan 7, 2025
1 parent 43c9cfe commit 49f25da
Showing 1 changed file with 3 additions and 4 deletions.
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
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";
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(() => {
Expand Down Expand Up @@ -109,10 +109,9 @@ export const ParticleBg = () => {
detectRetina: true,
};


const particlesLoaded = async (container: Container | undefined) => {
console.log(container);
};

return <Particles id="tsparticles" particlesLoaded={particlesLoaded} options={options as IOptions}/>;
};
});

0 comments on commit 49f25da

Please sign in to comment.