Improve performance of glamor benchmark renderer

This commit is contained in:
Sunil Pai
2017-04-08 01:57:45 +05:30
committed by Nicolas Gallagher
parent 50b168cc41
commit aa85876eb2
2 changed files with 19 additions and 20 deletions
+18 -19
View File
@@ -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;
+1 -1
View File
@@ -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',