Skip to content

feat: add useRiveList hook#89

Closed
mfazekas wants to merge 9 commits into
mainfrom
mfazekas/use-rive-list
Closed

feat: add useRiveList hook#89
mfazekas wants to merge 9 commits into
mainfrom
mfazekas/use-rive-list

Conversation

@mfazekas
Copy link
Copy Markdown
Collaborator

Summary

Adds useRiveList hook for managing list properties, aligned with rive-react API.

API

const { length, getInstanceAt, addInstance, addInstanceAt, removeInstance, removeInstanceAt, swap, error } = useRiveList('items', viewModelInstance);

Example

const { length, addInstance, removeInstanceAt, swap } = useRiveList('ListItemVM', instance);

// Add new item
const newItem = viewModel.createInstance();
addInstance(newItem);

// Remove item
removeInstanceAt(0);

// Swap items
swap(0, 1);

Test plan

  • Updated example to use useRiveList hook

@mfazekas mfazekas closed this Dec 16, 2025
@mfazekas mfazekas deleted the mfazekas/use-rive-list branch December 16, 2025 13:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant