Skip to content

Commit 3ca5202

Browse files
committed
solution: working message form input
1 parent 1c248ff commit 3ca5202

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/components/MessageForm/index.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,12 @@ import { MAX_MESSAGE_TEXT_LENGTH } from "../../config";
77
import "./styles.css";
88

99
export const MessageForm = ({ user }) => {
10-
let text = "";
10+
const [text, setText] = React.useState("");
1111

1212
const handleChange = event => {
1313
event.preventDefault();
1414
const updatedText = event.target.value;
15-
text = updatedText; // TODO: update text on change
15+
setText(updatedText);
1616
};
1717

1818
return (

0 commit comments

Comments
 (0)