Skip to content

Instantly share code, notes, and snippets.

@nicreichert
Last active June 28, 2017 11:17
Show Gist options
  • Save nicreichert/34d721234c229ca41711848e5b2a988a to your computer and use it in GitHub Desktop.
Save nicreichert/34d721234c229ca41711848e5b2a988a to your computer and use it in GitHub Desktop.
import React, { Component } from 'react';
import styled from 'styled-components';
const Wrapper = styled.div`
border-radius: 5px;
border: 1px solid #FAFAFA;
/* whatever other rules apply */
`;
const styledHoc = (WrappedComponent) => {
class StyledHoc extends Component {
render() {
return (
<Wrapper>
<WrappedComponent {...this.props} />
</Wrapper>
);
}
}
};
export default styledHoc;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment