Skip to content

Commit 18427aa

Browse files
PeterDekkersnecolas
authored andcommitted
[fix] Avoid use of Object.values
Improve compatibility with older browsers (without polyfilling) Close #1541
1 parent a7ab961 commit 18427aa

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

packages/react-native-web/src/exports/StyleSheet/createStyleResolver.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -237,7 +237,8 @@ export default function createStyleResolver() {
237237
styleProp === 'scrollbarWidth'
238238
) {
239239
const a = atomic({ [styleProp]: value });
240-
Object.values(a).forEach(({ identifier, rules }) => {
240+
Object.keys(a).forEach(key => {
241+
const { identifier, rules } = a[key];
241242
props.classList.push(identifier);
242243
rules.forEach(rule => {
243244
sheet.insert(rule, STYLE_GROUPS.atomic);
@@ -287,7 +288,8 @@ export default function createStyleResolver() {
287288
const style = rules[name];
288289
const compiled = classic(style, name);
289290

290-
Object.values(compiled).forEach(({ identifier, rules }) => {
291+
Object.keys(compiled).forEach(key => {
292+
const { identifier, rules } = compiled[key];
291293
resolved.css[identifier] = { group: group || STYLE_GROUPS.classic, rules };
292294
result[name] = identifier;
293295
});

0 commit comments

Comments
 (0)