Chrysolites Tech Academy

Video by HeyTimDev · streamed from YouTube. All rights remain with the creator.

Lesson 12: Building the Comment Section

About this lesson

In this tutorial, HeyTimDev adds a dynamic comment section to the short-video app, so that users can leave comments on videos and see each other's responses, in a way that feels similar to a chat. It begins by creating the comment section for videos with React Native, as the screen that opens when a user taps the comment icon in the overlay built in the previous part. You then fetch and display the comments from Supabase, linked to each video by its id, so that every video shows only its own conversation. A text input is implemented so that users can post their own comments, which are saved to the database and appear in the list. To make the section feel personal and easy to follow, the video displays the commenter's information, such as their profile picture and username, alongside each comment. Typing on a phone brings its own challenges, so the tutorial shows how to handle keyboard input and how to dismiss the keyboard using React Native's keyboard-avoiding view, so that the on-screen keyboard does not hide the input or the comments. The comments themselves are structured in a FlatList for efficient rendering, so that the screen stays smooth even when a video has many comments. By the end of the video, the app has a fully functional comment section that lets users interact with videos through comments, and the next part extends the same ideas towards private chats and tidies up the components. Afterwards, read Chapter 12 of the course book, which works out relative comment times by hand.

Install Chrysolites Tech Academy

Android / Chrome / Edge: open the browser menu and choose Install app or Add to Home screen.

iPhone / iPad (Safari): tap the Share button, then Add to Home Screen.