DEV Community

Minsu Kim
Minsu Kim

Posted on

3 2

Hacktoberfest #4

The last PR that I have contribute is ChatSociety & PR. The ChatSociety is simple chat application that user can join and have communication like Discord channel and Slack room. The issue is the scroll-view on holds very top of message even there are new message on the bottom when user joins the chat room after log-in
issue

This issue is very familiar to me because I have chance to use React and Hook on the Hacktoberfest#1. As soon as I reviewed the code, there is no useEffect for controlling scroll-view side-effects in functional components like componentDidMount and componentDidUpdate in React class. But the project maintainer has created useRef called dummy for updating the scroll-view when user enter the new message. Therefore instead of having duplicate code for same functionality. I have create a function called scrollToBottom which scroll to bottom with smooth animation. I have placed scrollToBottom function inside of useEffect and replace ScrollToBottom to SendMessage function where the update scroll-view when user enters the new message.

Issue-After

Sample Site

All the processes of fixing the issue are very straightforward. The only part that I have little stuck is how to implement auto scroll to bottom of the page. It is always good practice that research on the Mozilla MDN website first if I have concern with JavaScript.

After I have done 4 pull requests during the Hacktoberfest, it is kind of sad that I only used React, JavaScript, HTML, and CSS. There are many open-source project written with Python and other programming language. I intended to join the open-source project that involves web development because I want to focus on web. Next year I would like to learn different languages and challenge myself to join open-source project.

Heroku

Build apps, not infrastructure.

Dealing with servers, hardware, and infrastructure can take up your valuable time. Discover the benefits of Heroku, the PaaS of choice for developers since 2007.

Visit Site

Top comments (0)

Qodo Takeover

Introducing Qodo Gen 1.0: Transform Your Workflow with Agentic AI

Rather than just generating snippets, our agents understand your entire project context, can make decisions, use tools, and carry out tasks autonomously.

Read full post

👋 Kindness is contagious

Please leave a ❤️ or a friendly comment on this post if you found it helpful!

Okay