Update Input.md
This commit is contained in:
@ -6,12 +6,12 @@ Use object destructuring to set defaults for certain attributes of the `<input>`
|
|||||||
Render an `<input>` element with the appropriate attributes and use the `callback` function in the `onChange` event to pass the value of the input to the parent.
|
Render an `<input>` element with the appropriate attributes and use the `callback` function in the `onChange` event to pass the value of the input to the parent.
|
||||||
|
|
||||||
```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={(event) => callback(event.target.value)}
|
||||||
/>
|
/>
|
||||||
|
|||||||
Reference in New Issue
Block a user