update input to use destructuring
This commit is contained in:
@ -8,12 +8,12 @@ Render an `<input>` element with the appropriate attributes and use the `callbac
|
|||||||
```jsx
|
```jsx
|
||||||
function Input ({ callback, type = 'text', disabled = false, readOnly = false, placeholder = '' }) {
|
function Input ({ callback, type = 'text', disabled = false, readOnly = false, placeholder = '' }) {
|
||||||
return (
|
return (
|
||||||
<input
|
<input
|
||||||
type={type}
|
type={type}
|
||||||
disabled={disabled}
|
disabled={disabled}
|
||||||
readOnly={readOnly}
|
readOnly={readOnly}
|
||||||
placeholder={placeholder}
|
placeholder={placeholder}
|
||||||
onChange={(event) => callback(event.target.value)}
|
onChange={({ target: { value }}) => callback(value)}
|
||||||
/>
|
/>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user