rive-app / rive-app/rive-react

rive animation first time load failed

Open
#233 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
TypeScript
Stars
1.2k
Forks
58
Avg merge
3h 23m
Merged PRs (30d)
6

Description

Hi guys, i am using next 13 with "@rive-app/react-canvas": "^4.8.1"
and this is my code

  const { RiveComponent, rive } = useRive({
    src: "xxxx.riv",
    stateMachines: STATE_MACHINE_NAME,
    artboard: "xxxx",
    autoplay: true,
    layout: new Layout({ fit: Fit.Contain }),
  }); 

sometimes the animation cant autoplay properly, (it looks broken like how it look in rive app before start the animation)
its like 25% chance this will happened and i cant find a way to detect it.

i tried below it also doesnt work

autoplay: false
useEffect(()=>{ if(rive) rive.play()},[])
or
useEffect(()=>{ if(rive) rive.play()},[rive])


Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the reported Next 13 useRive configuration using @rive-app/react-canvas, then trace the RiveComponent and rive.play() entry points involved when the animation first loads. Reproduce the intermittent failure and compare autoplay with the provided effect-based playback attempts; done means the first-load animation behavior is reliably understood and corrected or the failure can be detected.

Written by the indexing model from the issue text.

Assessment

Tech stack
next.js, react, typescript
Domain
frontend
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.