VincentGarreau / particles.js

A lightweight JavaScript library for creating particles
https://vincentgarreau.com/particles.js/
MIT License
28.93k stars 4.82k forks source link

How to setup particles.js with React ? #483

Open Kasunjalitha opened 2 years ago

Kasunjalitha commented 2 years ago

I wanna setup this particles.js library with React application. I have installed with npm install particles.js. Then how to import it and use it? Where should I put particlesjs-config.json file?

matteobruni commented 2 years ago

You don't need to install that package to have particles in React. There's this package that already creates a particles component in React: https://github.com/Wufe/react-particles-js

There's a deprecation notice here: https://github.com/Wufe/react-particles-js#warning-deprecation-notice that recommends to migrate to react-tsparticles

bruno2galdino commented 2 years ago

OoWw can't use it in react?

matteobruni commented 2 years ago

OoWw can't use it in react?

It’s not recommended since there's a memory leak that can worsen the website performance

You can see an example of that issue here: https://codepen.io/matteobruni/pen/dyZeYOg