Update Input.md

This commit is contained in:
Angelos Chalaris
2018-12-10 10:16:44 +02:00
committed by GitHub
parent 2bf1fe77ba
commit 9aa3b89a66

View File

@ -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.
```jsx
function Input ({ callback, type = 'text', disabled = false, readonly = false, placeholder = '' }) {
function Input ({ callback, type = 'text', disabled = false, readOnly = false, placeholder = '' }) {
return (
<input
type={type}
disabled={disabled}
readonly={readonly}
readOnly={readOnly}
placeholder={placeholder}
onChange={(event) => callback(event.target.value)}
/>