Put in order · Vibe coding with Claude Code course · Module 5: Reddit clone

Sorting: The path of a new reply

Order what happens after a reply is sent under Polly's comment:

Items to put in order

  • Polly's CommentThread draws the reply with depth one larger
  • ReplyForm calls onReply with Polly's comment id and the text
  • buildCommentTree arranges the new tree
  • React renders CommentSection again
  • addComment appends a comment with Polly's parentId to the end of the flat list

You can check the correct answer by solving this task in the CodeWorlds game.