Created
June 16, 2015 16:37
-
-
Save jbmusso/896a389ba707fe583ddc to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
'use strict'; | |
import React from 'react'; | |
export default class Clearfix extends React.Component { | |
render() { | |
const beforeStyle = { | |
display: 'table' | |
}; | |
const afterStyle = { | |
...beforeStyle, | |
clear: 'both' | |
}; | |
return ( | |
<div {...this.props}> | |
<div style={beforeStyle}/> | |
{this.props.children} | |
<div style={afterStyle}/> | |
</div> | |
); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
simple and good job! 👍