Skip to content

Commit 84184ad

Browse files
Omit keys correctly
1 parent ddc8ab9 commit 84184ad

1 file changed

Lines changed: 4 additions & 3 deletions

File tree

lib/src/util/map_util.dart

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -128,18 +128,19 @@ void forwardUnconsumedPropsV2(Map props, {
128128
if (keySetsToOmit != null) {
129129
keySetsToOmit.forEach((keySet) => keySetToOmit.addAll(keySet));
130130
}
131+
if (omitReactProps) {
132+
keySetToOmit.addAll(const ['key', 'ref', 'children']);
133+
}
131134

132135
for (final key in props.keys) {
133-
if (keysToOmit != null && keysToOmit.contains(key)) continue;
136+
if (keySetToOmit.contains(key)) continue;
134137

135138
if (onlyCopyDomProps && !((key is String && (key.startsWith('aria-') ||
136139
key.startsWith('data-'))) ||
137140
_validDomProps.contains(key))) {
138141
continue;
139142
}
140143

141-
if (omitReactProps && const {'key', 'ref', 'children'}.contains(key)) continue;
142-
143144
propsToUpdate[key] = props[key];
144145
}
145146
}

0 commit comments

Comments
 (0)