Skip to content

Commit 92f3165

Browse files
committed
fix: call playIfNeeded after list modifications, remove unused default ctor
1 parent eaae9dd commit 92f3165

3 files changed

Lines changed: 4 additions & 4 deletions

File tree

example/assets/list.riv

1.03 KB
Binary file not shown.

example/src/pages/DataBindingListExample.tsx

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -92,24 +92,28 @@ function ListExample({
9292
stringProp.value = 'new btn';
9393
}
9494
listProperty.append(newInstance);
95+
riveRef.current?.playIfNeeded();
9596
refreshLength();
9697
}, [listProperty, file, refreshLength]);
9798

9899
const handleRemoveFirst = useCallback(() => {
99100
if (!listProperty || listProperty.length === 0) return;
100101
listProperty.removeAt(0);
102+
riveRef.current?.playIfNeeded();
101103
refreshLength();
102104
}, [listProperty, refreshLength]);
103105

104106
const handleRemoveLast = useCallback(() => {
105107
if (!listProperty || listProperty.length === 0) return;
106108
listProperty.removeAt(listProperty.length - 1);
109+
riveRef.current?.playIfNeeded();
107110
refreshLength();
108111
}, [listProperty, refreshLength]);
109112

110113
const handleSwapFirstTwo = useCallback(() => {
111114
if (!listProperty || listProperty.length < 2) return;
112115
listProperty.swap(0, 1);
116+
riveRef.current?.playIfNeeded();
113117
refreshLength();
114118
}, [listProperty, refreshLength]);
115119

ios/HybridViewModelListProperty.swift

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,6 @@ class HybridViewModelListProperty: HybridViewModelListPropertySpec, ValuedProper
99
super.init()
1010
}
1111

12-
override init() {
13-
super.init()
14-
}
15-
1612
var length: Double {
1713
Double(property.count)
1814
}

0 commit comments

Comments
 (0)