pass all props through to <input />

main
Mike Fix 6 years ago committed by Michael Fix
parent ffbf512a38
commit 297c385fbb

@ -2,35 +2,9 @@ import React from 'react'
import { COLORS } from '../lib/constants' import { COLORS } from '../lib/constants'
const Input = React.forwardRef( const Input = React.forwardRef(({ color = COLORS.SECONDARY, align = 'right', ...props }, ref) => (
(
{
accept,
color = COLORS.SECONDARY,
name,
onChange = () => {},
placeholder,
title,
type,
value,
align = 'right',
maxLength
},
ref
) => {
return (
<React.Fragment> <React.Fragment>
<input <input ref={ref} {...props} />
ref={ref}
type={type}
accept={accept}
title={title}
placeholder={placeholder}
value={value}
name={name}
onChange={onChange}
maxLength={maxLength}
/>
<style jsx> <style jsx>
{` {`
input { input {
@ -58,8 +32,6 @@ const Input = React.forwardRef(
`} `}
</style> </style>
</React.Fragment> </React.Fragment>
) ))
}
)
export default Input export default Input

Loading…
Cancel
Save