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'
const Input = React.forwardRef(
(
{
accept,
color = COLORS.SECONDARY,
name,
onChange = () => {},
placeholder,
title,
type,
value,
align = 'right',
maxLength
},
ref
) => {
return (
const Input = React.forwardRef(({ color = COLORS.SECONDARY, align = 'right', ...props }, ref) => (
<React.Fragment>
<input
ref={ref}
type={type}
accept={accept}
title={title}
placeholder={placeholder}
value={value}
name={name}
onChange={onChange}
maxLength={maxLength}
/>
<input ref={ref} {...props} />
<style jsx>
{`
input {
@ -58,8 +32,6 @@ const Input = React.forwardRef(
`}
</style>
</React.Fragment>
)
}
)
))
export default Input

Loading…
Cancel
Save