diff options
Diffstat (limited to 'public/projects/react-small-apps/apps/todos/src/components/forms/TextArea')
| -rw-r--r-- | public/projects/react-small-apps/apps/todos/src/components/forms/TextArea/TextArea.js | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/public/projects/react-small-apps/apps/todos/src/components/forms/TextArea/TextArea.js b/public/projects/react-small-apps/apps/todos/src/components/forms/TextArea/TextArea.js new file mode 100644 index 0000000..78a10b6 --- /dev/null +++ b/public/projects/react-small-apps/apps/todos/src/components/forms/TextArea/TextArea.js @@ -0,0 +1,24 @@ +function TextArea({ label, id, value, updateValue }) { + const handleChange = (e) => { + updateValue(e.target.value); + }; + + return ( + <> + {label ? ( + <label htmlFor={id} className="form__label"> + {label} + </label> + ) : ( + "" + )} + <textarea + value={value} + onChange={handleChange} + className="form__field form__field--textarea" + /> + </> + ); +} + +export default TextArea; |
