feat: user better syntax for defining ui components

This commit is contained in:
fragosti
2018-10-19 13:45:12 -07:00
parent 43ad2fe23b
commit d5105b5c9f
4 changed files with 4 additions and 18 deletions

View File

@@ -12,11 +12,7 @@ export interface InputProps {
onChange?: (event: React.ChangeEvent<HTMLInputElement>) => void;
}
const PlainInput: React.StatelessComponent<InputProps> = ({ value, className, placeholder, onChange }) => (
<input className={className} value={value} onChange={onChange} placeholder={placeholder} />
);
export const Input = styled(PlainInput)`
export const Input = styled<InputProps, 'input'>('input')`
font-size: ${props => props.fontSize};
width: ${props => props.width};
padding: 0.1em 0em;