mirror of
https://github.com/zoriya/react-native-web.git
synced 2026-06-01 18:15:13 +00:00
Improve performance of glamor benchmark renderer
This commit is contained in:
committed by
Nicolas Gallagher
parent
50b168cc41
commit
aa85876eb2
@@ -1,5 +1,4 @@
|
|||||||
/* eslint-disable react/prop-types */
|
/* eslint-disable react/prop-types */
|
||||||
import { css } from 'glamor';
|
|
||||||
import React from 'react';
|
import React from 'react';
|
||||||
import View from '../View/index.glamor';
|
import View from '../View/index.glamor';
|
||||||
|
|
||||||
@@ -16,34 +15,34 @@ const Box = ({ color, fixed = false, layout = 'column', outer = false, ...other
|
|||||||
);
|
);
|
||||||
|
|
||||||
const styles = {
|
const styles = {
|
||||||
outer: css({
|
outer: {
|
||||||
padding: 4
|
padding: 4
|
||||||
}),
|
},
|
||||||
row: css({
|
row: {
|
||||||
flexDirection: 'row'
|
flexDirection: 'row'
|
||||||
}),
|
},
|
||||||
color0: css({
|
color0: {
|
||||||
backgroundColor: '#222'
|
backgroundColor: '#222'
|
||||||
}),
|
},
|
||||||
color1: css({
|
color1: {
|
||||||
backgroundColor: '#666'
|
backgroundColor: '#666'
|
||||||
}),
|
},
|
||||||
color2: css({
|
color2: {
|
||||||
backgroundColor: '#999'
|
backgroundColor: '#999'
|
||||||
}),
|
},
|
||||||
color3: css({
|
color3: {
|
||||||
backgroundColor: 'blue'
|
backgroundColor: 'blue'
|
||||||
}),
|
},
|
||||||
color4: css({
|
color4: {
|
||||||
backgroundColor: 'orange'
|
backgroundColor: 'orange'
|
||||||
}),
|
},
|
||||||
color5: css({
|
color5: {
|
||||||
backgroundColor: 'red'
|
backgroundColor: 'red'
|
||||||
}),
|
},
|
||||||
fixed: css({
|
fixed: {
|
||||||
width: 20,
|
width: 20,
|
||||||
height: 20
|
height: 20
|
||||||
})
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
module.exports = Box;
|
module.exports = Box;
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
import { css } from 'glamor';
|
import { css } from 'glamor';
|
||||||
import React from 'react';
|
import React from 'react';
|
||||||
|
|
||||||
const View = props => <div {...props} className={css(viewStyle, props.style)} />;
|
const View = ({ style, ...props}) => <div {...props} className={css(viewStyle, ...style)} />;
|
||||||
|
|
||||||
const viewStyle = {
|
const viewStyle = {
|
||||||
alignItems: 'stretch',
|
alignItems: 'stretch',
|
||||||
|
|||||||
Reference in New Issue
Block a user