'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
This comment has been minimized.
simple and good job!👍