-
-
Notifications
You must be signed in to change notification settings - Fork 305
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Using hover-effect in a React component #15
Comments
Hey Nick, Sorry for the late reply, unfortunately I don't have React knowledge so I won't be able to help you. Cheers |
Hey @Nicknyr, You should create your instance inside ComponentDidMount instead of the render() function. Something like that:
|
Hey guys, I'm getting the mistake Regards:) |
its worked for me |
tested after fix |
Does somebody have a full example? I am using functional components, but still, don't understand why to define a const animation if I am not using it anywhere. |
import React,{useRef,useEffect} from 'react' let var=useRef(null) ......... var=el}>
this worked for me |
How? Im working in Vue especially nuxt, and i cant figure out how i have to implement this.. import just doesnt work |
Try to install the repo in my git i tested to in nuxt |
Yes It Worked Component const Displacement = () => {
} export default Displacement SCSS .img-container { |
Would anyone know how to use the .next() function of the library inside an onClick event?
|
hi , You must call the function "animation" (invoke it) so it can work , you must use use Effect |
does anybody know how do I run it with prev & next buttons ? |
Hello, can someone explain to me why importing hover Effect gives me an error? I am using React. |
Hi, in order to use the Next & prev buttons with React, I used this way:
note this way will not loop through the images, so for example, if you have 2 images, clicking the next button for the 2nd time will not work until you click the prev button, you could improve it by using a state to check the image index and a new function to call Next or Prev depends on the index |
make sure to give the parent div a fixed height, this way the canvas gonna take the same height that the parent div has |
Yeah, I've already figured it out and implemented. It works! The only trouble was to make it adaptive, as I have three photos in a row and the screen is full width, so starting 1200px and higher the width and height change. But I solved it too. If setting height inline in html template it does not work. So I used a dynamic variable and height property in styles. In this case it works and it's adaptive! I can share the code. |
Hi everyone! Does anyone know how to trigger a hover effect using the parent element ? I tried using the mouseenter and mouseout events but it didn’t work. Any ideas? |
How would I use hover-effect in a React component? I've tried the following but I can't seem to get it to work. Had someone on Stack Overflow recommend using refs in place of document.querySelector.
The text was updated successfully, but these errors were encountered: