-
Notifications
You must be signed in to change notification settings - Fork 38
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
useRive hook displays nothing. #36
Comments
Hey @Oriole-Alex! From what I can see it looks like you're doing everything right. I suspect the issue could be with how you're hosting the .riv file. How is it hosted? Do you see any errors in the console when you try to run this code? Does it work when you a different file hosted online in the src, e.g this one from our community: https://public.rive.app/community/runtime-files/736-1464-translationscale-constraints-demo.riv? |
Hi Avivian, Thanks for the quick response! Very strange, you are completely right, swapping in the url you provided displays the animation perfectly with zero code changes. Any idea why your hosted animation works whereas the locally stored file only works in the basic component and not with the hook? |
I'm not sure, the basic component is using the hook under the hood! Can you give me some example code showing my how your code with the basic component works? How are your assets hosted within your app? Are you using We have an example of using the hook with static files here https://github.com/rive-app/rive-react/tree/main/examples/basic-with-hook that might be worth having a look at to see a working example! |
Hi avivian, Sorry for the slow reply. Turned out I was just calling the element badly - all good now :) thanks for the help! One other question - is there a way to reverse the animation? I can only see .play and .pause but no .reverse? |
We don't have the ability to reverse the animation in the rive-js runtime right now. Something I can look at adding if you raise an issue in the https://github.com/rive-app/rive-wasm repo! |
Hi,
Probably just me missing something simple - I'm able to display my .riv animation with Rive /> however when i try to use the with the useRive hook and pass in parameters, i get no content displayed on screen. Below is the code im using, literally nothing else in the React app as I just wanted to test this (loving the animation tools on the website btw!)
I'm using React "^17.0.2" and "rive-react": "latest"
any help would be really appreciated :)
import { useRive } from 'rive-react';
function App() {
}
export default App;
The text was updated successfully, but these errors were encountered: