Skip to content

Commit 1c88f0f

Browse files
Fix more implicit casts in examples
1 parent f1101b7 commit 1c88f0f

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

example/test/react_test_components.dart

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -169,7 +169,7 @@ class _ListComponent extends react.Component {
169169
@override
170170
render() {
171171
final items = [];
172-
for (final item in state['items']) {
172+
for (final item in state['items'] as List) {
173173
items.add(react.li({'key': item}, '$item'));
174174
}
175175

@@ -473,7 +473,7 @@ class _Component2TestComponent extends react.Component2 with react.TypedSnapshot
473473
// Used to generate unique keys even when the list contains duplicate items
474474
final itemCounts = <dynamic, int>{};
475475
final items = [];
476-
for (final item in state['items']) {
476+
for (final item in state['items'] as List) {
477477
final count = itemCounts[item] = (itemCounts[item] ?? 0) + 1;
478478
items.add(react.li({'key': 'c2-$item-$count'}, '$item'));
479479
}

example/test/speed_test.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ class _Hello extends react.Component {
5353
@override
5454
render() {
5555
timeprint('rendering start');
56-
final data = props['data'];
56+
final data = props['data'] as List;
5757
final children = [];
5858
for (final elem in data) {
5959
children.add(react.div({

0 commit comments

Comments
 (0)