diff --git a/snippets/Input.md b/snippets/Input.md index aab046860..d7734e36a 100644 --- a/snippets/Input.md +++ b/snippets/Input.md @@ -8,12 +8,12 @@ Render an `` element with the appropriate attributes and use the `callbac ```jsx function Input ({ callback, type = 'text', disabled = false, readOnly = false, placeholder = '' }) { return ( - callback(event.target.value)} + onChange={({ target: { value } }) => callback(value)} /> ); } diff --git a/snippets/Select.md b/snippets/Select.md index 1367e4d86..db4562517 100644 --- a/snippets/Select.md +++ b/snippets/Select.md @@ -4,17 +4,17 @@ Renders a `` element. Render a `` element. +Use destructuring on the `values` array to pass an array of `value` and `text` elements and the `selected` attribute to define the initial `value` of the ` callback(event.target.value)} + ); } diff --git a/snippets/TextArea.md b/snippets/TextArea.md index eb754c7b6..e67fac536 100644 --- a/snippets/TextArea.md +++ b/snippets/TextArea.md @@ -8,13 +8,13 @@ Render a `