Suggestions
Opened this issue · 1 comments
siddharthlatest commented
From UI / Ux
- It would be great to see a relative timestamp next to the chat message.
- Implement a presence mechanism to show currently online users.
Technical Feedback
metagrover commented
Technical Feedback
- frontpage.js Line 22 should be done this way:
editUsername(event) {
const username = event.target.value;
this.setState({ username });
}
or persist the event before passing it in the async setState
function. Read more here: https://facebook.github.io/react/docs/events.html
-
Same as [1] here.
-
You can get rid of empty else block here.
-
Ideally, you should be making async request (refer this) and manipulating DOM (which should also be improved & managed by react state logic instead of DOM manipulation) in the
componentDidMount
method. It works in this case only because by the time we get the results, component gets mounted and thechatbox-scroll
exists in the DOM. -
A better way to create unique ids will be to use libraries like
uuid
.