wufe / react-particles-js

Particles.js for React
https://rpj.bembi.dev/
MIT License
1.16k stars 106 forks source link

'canvas' / 'repulse' is not defined no-undef #52

Closed muravitsky closed 6 years ago

muravitsky commented 6 years ago

Hello! Thank you so much for so beautiful react module! I'm using it on my study project now. Unfortunately I can't use the "Interactivity" parameter :( It looks this way in my code: image And I got this error: image Other Particles features are already works perfect. Can you kindly help me with this issue? How I can enable Particles Interactivity in me React App? Thank you in advance!

wufe commented 6 years ago

Hi! You need to specify them as strings:

detect_on: "canvas", mode: "repulse"

muravitsky commented 6 years ago

@Wufe, thank you for your reply! Actually, I have tried to use this parameters as a string. It's compiled successfully but still nothing happens on the webpage when I try to use this beautiful onhover or onhlick effect. Here is my full list of parameters: image And I rendering Particles this way: <Particles className='particles' params = {ParticlesOptions}/> Just no hover effect :(

wufe commented 6 years ago

Hi @muravitsky , the params object is not correct: you nested "interactivity" into "particles".

Check this example:
Edit Minimal repulse

muravitsky commented 6 years ago

Thank you so much! It works! And it's just because of my inadvertence. Thank you so much one more time!

wufe commented 6 years ago

You are welcome 😁