rive-app / rive-app/rive-react
Issue: Re-mount RiveComponent multiple times cause web page laggy
Open
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 1.2k
- Forks
- 58
- Avg merge
- 3h 23m
- Merged PRs (30d)
- 6
Description
Steps to reproduce
- I use https://rive.app/marketplace/24941-46557-expression-grid/
- I have a Home page and a child page mount the RiveComponent
- then i enter & leave child page 10 times with react router
- entire page start laggy
const Animation = () => {
const { RiveComponent } = useRive({ src: './expression-grid.riv' })
return <RiveComponent />
}
Is there any possible WebGL context leaks?
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reproducing the report with the useRive hook and RiveComponent while repeatedly navigating with React Router between the Home and child pages. Inspect the mount and unmount lifecycle for the WebGL context leak suggested in the issue. Done means repeated mounts no longer make the page laggy and the behavior is covered by a suitable regression check.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- react, typescript
- Domain
- frontend, performance
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 30/100