Interactive vanilla comments with notification toast
Design comparison
Solution retrospective
How did everyone handled the reply part, where one user replies another who was also a replier of somebody else?
Community feedback
- @abdulqad33rPosted over 1 year ago
What I did was I map over the array and first matched the ID with the main comment, if ID matched, I added the reply in it's reply array, if ID is not found in the main comments then I check the ID in the replies array, if ID is found in the replies array then I just add that new element in that replies array. With matching ID I can also check whom the user is replying to.
0@aryanda1Posted over 1 year ago@abdulqad33r Can u explain more, like it was a main comment, and u click the reply submit button. What logic u used, and for replying in child replies what u did? I assigned the id of main comment to my main comment as well, so that i can extract the main id
0@abdulqad33rPosted over 1 year ago@aryanda1 It'll be hard to explain here, check my code of this project and you'll understand
0
Please log in to post a comment
Log in with GitHubJoin our Discord community
Join thousands of Frontend Mentor community members taking the challenges, sharing resources, helping each other, and chatting about all things front-end!
Join our Discord