Skip to content

Commit c4239ab

Browse files
committed
fix: lint error with revision
1 parent 22f8d5a commit c4239ab

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

src/hooks/useViewModelInstanceList.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,10 @@ export default function useViewModelInstanceList(
1616
): UseViewModelInstanceListResult {
1717

1818
// We track revision to trigger re-renders on list manipulation (e.g. addInstance, removeInstance, etc).
19-
// This is mostly important for things like the swap function which wouldn't trigger a re-render otherwise.
19+
// This is mostly important for things like the swap function which wouldn't trigger a re-render otherwise because it doesn't change the length of the list.
20+
// For example, if the user swaps two items in the list and we don't trigger a re-render, the user will see the old items if they were using the getInstanceAt function.
2021
// It also accounts for changes that happen within the Rive file itself rather than through the hook.
21-
const [_revision, setRevision] = useState(0);
22+
const [, setRevision] = useState(0);
2223

2324
const result = useViewModelInstanceProperty<ViewModelInstanceList, number, Omit<UseViewModelInstanceListResult, 'length'>>(
2425
path,

0 commit comments

Comments
 (0)