Skip to content

Instantly share code, notes, and snippets.

@apieceofbart
Created October 10, 2017 10:37
Show Gist options
  • Save apieceofbart/2e8142364616472c0120ceb49f425e85 to your computer and use it in GitHub Desktop.
Save apieceofbart/2e8142364616472c0120ceb49f425e85 to your computer and use it in GitHub Desktop.
Styled components with Typscript
import * as React from "react";
interface IProps {
children?: React.ReactChild;
className?: string;
}
class Button extends React.Component<IProps, {}> {
public render() {
return (
<button className={this.props.className}>
{ this.props.children }
</button>
);
}
}
const StyledButton = styled(Button)`
background-color: red;
color: white;
`
export default StyledButton;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment