Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
'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>
);
}
}
@iplus26

This comment has been minimized.

Copy link

@iplus26 iplus26 commented Sep 13, 2017

simple and good job! 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment