Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Preact Particles

I'm creating a Preact component for using tsParticles library but nothing appears.

I'm porting the React project but something isn't compatible probably.

You can checkout the component here: https://github.com/matteobruni/preact-particles

This is how I'm using it:

<Particles id="tsparticles" params={{
    background: {
        color: "#000000",
    },
    particles: {
        number: { value: 100 },
        move: { enable: true }
    }
}} />
like image 502
Caelan Avatar asked Jul 04 '26 19:07

Caelan


1 Answers

It was the componentShouldUpdate method with a weak condition that didn't worked with Preact.

like image 57
Caelan Avatar answered Jul 06 '26 10:07

Caelan



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!