mirror of
https://github.com/zoriya/react-native-web.git
synced 2026-06-01 10:07:35 +00:00
Use default array sort function
This commit is contained in:
@@ -66,17 +66,6 @@ const monospaceFontStack = 'monospace, monospace';
|
|||||||
const systemFontStack =
|
const systemFontStack =
|
||||||
'system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Ubuntu, "Helvetica Neue", sans-serif';
|
'system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Ubuntu, "Helvetica Neue", sans-serif';
|
||||||
|
|
||||||
const alphaSortProps = propsArray =>
|
|
||||||
propsArray.sort((a, b) => {
|
|
||||||
if (a < b) {
|
|
||||||
return -1;
|
|
||||||
}
|
|
||||||
if (a > b) {
|
|
||||||
return 1;
|
|
||||||
}
|
|
||||||
return 0;
|
|
||||||
});
|
|
||||||
|
|
||||||
const defaultOffset = { height: 0, width: 0 };
|
const defaultOffset = { height: 0, width: 0 };
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -324,7 +313,7 @@ const createReactDOMStyle = style => {
|
|||||||
return emptyObject;
|
return emptyObject;
|
||||||
}
|
}
|
||||||
const styleProps = Object.keys(style);
|
const styleProps = Object.keys(style);
|
||||||
const sortedStyleProps = alphaSortProps(styleProps);
|
const sortedStyleProps = styleProps.sort();
|
||||||
const reducer = createReducer(style, styleProps);
|
const reducer = createReducer(style, styleProps);
|
||||||
const resolvedStyle = sortedStyleProps.reduce(reducer, {});
|
const resolvedStyle = sortedStyleProps.reduce(reducer, {});
|
||||||
return resolvedStyle;
|
return resolvedStyle;
|
||||||
|
|||||||
Reference in New Issue
Block a user