mirror of
https://github.com/zhigang1992/react-native-web.git
synced 2026-05-16 08:30:06 +08: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 */
|
||||
import { css } from 'glamor';
|
||||
import React from 'react';
|
||||
import View from '../View/index.glamor';
|
||||
|
||||
@@ -16,34 +15,34 @@ const Box = ({ color, fixed = false, layout = 'column', outer = false, ...other
|
||||
);
|
||||
|
||||
const styles = {
|
||||
outer: css({
|
||||
outer: {
|
||||
padding: 4
|
||||
}),
|
||||
row: css({
|
||||
},
|
||||
row: {
|
||||
flexDirection: 'row'
|
||||
}),
|
||||
color0: css({
|
||||
},
|
||||
color0: {
|
||||
backgroundColor: '#222'
|
||||
}),
|
||||
color1: css({
|
||||
},
|
||||
color1: {
|
||||
backgroundColor: '#666'
|
||||
}),
|
||||
color2: css({
|
||||
},
|
||||
color2: {
|
||||
backgroundColor: '#999'
|
||||
}),
|
||||
color3: css({
|
||||
},
|
||||
color3: {
|
||||
backgroundColor: 'blue'
|
||||
}),
|
||||
color4: css({
|
||||
},
|
||||
color4: {
|
||||
backgroundColor: 'orange'
|
||||
}),
|
||||
color5: css({
|
||||
},
|
||||
color5: {
|
||||
backgroundColor: 'red'
|
||||
}),
|
||||
fixed: css({
|
||||
},
|
||||
fixed: {
|
||||
width: 20,
|
||||
height: 20
|
||||
})
|
||||
}
|
||||
};
|
||||
|
||||
module.exports = Box;
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
import { css } from 'glamor';
|
||||
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 = {
|
||||
alignItems: 'stretch',
|
||||
|
||||
Reference in New Issue
Block a user