WATCH NEXT: React Interview Questions and Answers - Dominate Your Next Interview - kzbin.info/www/bejne/r4Kro2elpd-ShJIsi=51b2XP_84GH3q6oF
@zacharymedellin68893 жыл бұрын
Any chance you have a video or some help connecting all of this work to a mongoDB or some sort of nonSQL? Really loved the video and super helpful for my project.
@MonsterlessonsAcademy3 жыл бұрын
@@zacharymedellin6889 I have a video about building API with express and mongodb. kzbin.info/www/bejne/h6uTiJaCpa2sb7c
@alirezaghadyani162 жыл бұрын
test
@alirezaghadyani162 жыл бұрын
testtt
@alirezaghadyani162 жыл бұрын
testttttt
@mr_ani2 жыл бұрын
For anyone wondering how to nest infinitely or set the max nesting at a predefined level, it is pretty straightforward to do given the code already. Even though like the author said, it is not performant and is discouraged to go beyond 2 levels, it can be done. All you need to do is replace the replies prop that is passed into with the getReplies callback, and then get the replies for that comment by calling that callback within Comment. You can also add an extra "nesting level" property to comment which will be incremented whenever you reply a comment. You can then disable the reply button based on whether or not this property has reached the max threshold.
@MonsterlessonsAcademy2 жыл бұрын
You are completely correct!
@mimi-mh5th2 жыл бұрын
@@MonsterlessonsAcademy Can you further explain how we can do this. Currently, it seems that each comment is assigned the the 1-level parent id so rendering is not achieved.
@MonsterlessonsAcademy2 жыл бұрын
@@mimi-mh5th Unfortunately I can't help with specific implementation of your case.
@RomainKabasi Жыл бұрын
@@MonsterlessonsAcademy good
@mackzane9624 Жыл бұрын
@@mimi-mh5th did you find a way for your problem, I am also looking for something like you mentioned?
@moonkin3403 жыл бұрын
Thanks for the explanation. Usually when comments can have replies, replies can have replies too. My next challenge is to find out how I can Map a flat array to a tree view and render nested components based on my data.
@MonsterlessonsAcademy3 жыл бұрын
If you check any commenting systems like youtube/etc normally it's allowed to have just 1 level on replies on replies. Which means it is not nested indefinitely. It improves performance and simplifies support. This is exactly how I did it in this video. We used parent Id instead of replyID
@galdinorosas39172 жыл бұрын
@@MonsterlessonsAcademy test comment 3rd level
@jx85512 жыл бұрын
@@MonsterlessonsAcademy really there is no third level
@gabrielfono8442 жыл бұрын
it is amazing
@adarshkushwaha37152 жыл бұрын
@@MonsterlessonsAcademy great
@codexjay6742 жыл бұрын
Amazing tutorial This is just what I was looking for 🔥🔥
@MonsterlessonsAcademy2 жыл бұрын
Glad you liked it!
@BabalolaYusuf-pm5dt6 ай бұрын
Just what I've been looking for. Thank you!
@MonsterlessonsAcademy6 ай бұрын
Glad I could help!
@Fatima-yar3 ай бұрын
Finally found what I really needed! That was awesome!! Thanks! 🎉🎉
@MonsterlessonsAcademy3 ай бұрын
Glad it helped!
@yourSOULismy2 жыл бұрын
Thank you very much. If I get a job, you have my donate. I will buy some courses. Double win for us
@MonsterlessonsAcademy2 жыл бұрын
Best of luck!
@shikharpandya49279 ай бұрын
thanks a lot sir for an amazing tutorial😍
@MonsterlessonsAcademy9 ай бұрын
Most welcome!
@jayeshkarkare93343 жыл бұрын
Awesome and well explained tutorial.Thankyou
@MonsterlessonsAcademy3 жыл бұрын
Glad you liked it
@karanjathoul88952 жыл бұрын
Amazing video. Thankyou for posting such an easy to understand and accurate tutorial..
@MonsterlessonsAcademy2 жыл бұрын
Glad it was helpful!
@davidgomez6823 Жыл бұрын
Man thank you very much for this, this is lifetime knowledge, very appreciated.
@MonsterlessonsAcademy Жыл бұрын
Glad it was helpful!
@Manpreetkaur-xr7cg4 ай бұрын
@@MonsterlessonsAcademy helpful
@sergioyepes28652 жыл бұрын
amazing video monster, thanks for that, greetings from Colombia
@MonsterlessonsAcademy2 жыл бұрын
My pleasure!
@andromadusnaruto15443 жыл бұрын
Awesome guide, very helpful. Thank you.
@MonsterlessonsAcademy3 жыл бұрын
You are welcome!
@christopheracevedogalo48253 жыл бұрын
@@MonsterlessonsAcademy nice
@AI_for_funn Жыл бұрын
god level teaching , love from india
@MonsterlessonsAcademy Жыл бұрын
Thank you!
@prashanthdasar-rm2oz6 ай бұрын
Sir very thanks for teaching this code.
@MonsterlessonsAcademy6 ай бұрын
It's my pleasure
@dunder94442 жыл бұрын
you are really awesome dude. you saved me from my sanity
@MonsterlessonsAcademy2 жыл бұрын
Glad to hear that!
@dalimkumar3481 Жыл бұрын
it was a life saver for me
@MonsterlessonsAcademy Жыл бұрын
Great to hear!
@codinginflow Жыл бұрын
I like the approach with the flat comment array! Have you ever built such a comment system with pagination? I found that it makes it 10x more tricky 💀
@muhammedbojang54952 жыл бұрын
wow amazing video. kinda get lost when switching from one file to another i think vs code will be easier to follow along
@MonsterlessonsAcademy2 жыл бұрын
Thank you
@SteveAnthonyart2 жыл бұрын
I’m excited to dig into this! So if I have data from the backend like so… { feedback: blah blah, comments: [ { id: comment1, content: blah blah, replies: [ { id: reply1, content: blah blah }, ], }, ], } …would you flatten the data and patch the replies to look like comments then add parentId’s to them? Or would you approach it differently?
@MonsterlessonsAcademy2 жыл бұрын
I would never want to get from backend not flat data. it is not comfortable to work with them or I would directly normalize them in flat array on client. To build nested list you make your BE request slower and you give data to the client in format which is not comfortable to work with.
@gabrielfono8442 жыл бұрын
hi sir I build one of my apps and added a comment section using your logic. I wondering how to add time update like on reddit and getting comment update by seconds, min, hour, day , week , month and year. for example if the user comment now , I could display now . after a day , the commnent will be updated to a day , the same week , month and a year. I would really appreciate your answer
@MonsterlessonsAcademy2 жыл бұрын
You need to do it on the client. Something like setInterval in every comment which checks the date every N seconds and rerender the date.
@gabrielfono8442 жыл бұрын
@@MonsterlessonsAcademy great Thanks
@joseescalon75062 жыл бұрын
Hello! Is there any way the comments don't disappear after refreshing the page?
@MonsterlessonsAcademy2 жыл бұрын
No. You either need to implement backend or store them in local storage. I made a video how to implement it on backend kzbin.info/www/bejne/sIWtq5eDpdSUbsk
@ywb000218 Жыл бұрын
Thanks for good teaching!
@MonsterlessonsAcademy Жыл бұрын
You are welcome!
@bimbim18622 жыл бұрын
I implemented it in react native and it worked fine. the question is what database is recommended to accommodate this comment?
@MonsterlessonsAcademy2 жыл бұрын
You can use any database that you like. It will work everywhere.
@akashi44142 жыл бұрын
realy helpful video, thank u so much
@MonsterlessonsAcademy2 жыл бұрын
Glad it was helpful!
@ifydev5 ай бұрын
This was really helpful thanks a lot
@MonsterlessonsAcademy5 ай бұрын
Glad it helped
@mozartofcode16692 жыл бұрын
Great tutorial. Keep it up bro!
@MonsterlessonsAcademy2 жыл бұрын
Thanks, will do!
@DaveTradeFx_012 жыл бұрын
Thank you for your wonderful tutorial, can you also make a video that related to graph and charts for visualise data in react js?
@MonsterlessonsAcademy2 жыл бұрын
Thank you for the idea! I will add it to the list of future videos.
@shillo_a3 жыл бұрын
Just looking for this! Thanks!
@MonsterlessonsAcademy3 жыл бұрын
Glad I could help!
@JuventudLLAFederacionER2 жыл бұрын
Cómo hago para que al actualizar la página, no se borren los nuevos comentarios? Tenes algún video conectando este código con nodejs y una base de datos para ir guardando allí los nuevos comentarios?
@indranathghosh53272 жыл бұрын
Great Video! Really helpful. Thanks a lot.
@MonsterlessonsAcademy2 жыл бұрын
Glad it was helpful!
@vireltv2569 ай бұрын
Thanks for the video ! In a real application when you post/edit/delete we need to use http request from the backend with axios no ??
@MonsterlessonsAcademy9 ай бұрын
Yeap
@gonalestrelado2 жыл бұрын
Very good video. Thank you very much!
@MonsterlessonsAcademy2 жыл бұрын
You are welcome!
@SpawnProgram2 жыл бұрын
Great job! Is there any chance to see MarkDown here? So you can make text bold, italic, have an titles etc. inside comment's.
@MonsterlessonsAcademy2 жыл бұрын
Hi, thanks for the idea. I added it to the future list of videos.
@axelhobrecht2321 Жыл бұрын
thank you for this gem!
@MonsterlessonsAcademy Жыл бұрын
My pleasure!
@yadneshkhode30913 жыл бұрын
Thank you sir i was looking for this
@MonsterlessonsAcademy3 жыл бұрын
Happy to help!
@МаринаСтепанчук-ч1с Жыл бұрын
Thanks for the great video!
@MonsterlessonsAcademy Жыл бұрын
My pleasure!
@galdinorosas39172 жыл бұрын
this was an awesome video. really appreciate the details and explanations :)
@galdinorosas39172 жыл бұрын
tst 2nd level
@galdinorosas39172 жыл бұрын
test 3rd level
@galdinorosas39172 жыл бұрын
test 4th
@MonsterlessonsAcademy2 жыл бұрын
Glad you enjoyed it!
@muhammadhasan96682 жыл бұрын
@@MonsterlessonsAcademy yesbro
@elbezz2 жыл бұрын
awesome content, Thanks a lot for sharing!
@MonsterlessonsAcademy2 жыл бұрын
Glad you liked it!
@bellyndayikeza4799 Жыл бұрын
thanks that was really helpful
@MonsterlessonsAcademy Жыл бұрын
Glad it helped!
@yaasalu7 ай бұрын
Great tutorial
@MonsterlessonsAcademy7 ай бұрын
Glad you think so!
@keerthanaselvan-pw5el5 ай бұрын
Thank you for the video
@MonsterlessonsAcademy5 ай бұрын
Thanks for watching!
@ВячеславКузнецов-ъ3щ2 жыл бұрын
Greate 👍 fantastic lesson
@MonsterlessonsAcademy Жыл бұрын
Thanks! 😃
@pinh41332 жыл бұрын
Is super great keep it up bro !!!!!
@MonsterlessonsAcademy2 жыл бұрын
Thanks 🔥
@SajjadHematiNourani Жыл бұрын
please make the backend with node as well.
@MonsterlessonsAcademy Жыл бұрын
Here it is: kzbin.info/www/bejne/sIWtq5eDpdSUbsk
@SajjadHematiNourani Жыл бұрын
@@MonsterlessonsAcademy you are a coding God❤I love your work
@mayanksavaliya91002 жыл бұрын
Great video. Any idea how do I extend the functionality of this comment section with ability of tagging users in comment with '@' just like instagram allows dynamically?
@MonsterlessonsAcademy2 жыл бұрын
It's more advanced stuff. You need a handler when @ symbol is typed in input and return a list of users from the backend to autocomplete. Also every time when the commend is created you need to past mentioned user on backend and send him a notification.
@gabrielfono8442 жыл бұрын
thanks for htis amazing tutorials
@MonsterlessonsAcademy2 жыл бұрын
Glad you like them!
@nifazahamedcs20392 жыл бұрын
bro i need help i used your code and developed the ui but ineed to store the comments in aws s3 in json file an d to fetch the s3 items to be dispalyed .
@MonsterlessonsAcademy2 жыл бұрын
Unfortunately I don't review custom code because I don't have enough time for that.
@TheHaribols3 жыл бұрын
The source code after downloading just has 2 files, one only html and other js
@MonsterlessonsAcademy3 жыл бұрын
Did you use the correct url? I think you probably switched to master branch github.com/monsterlessonsacademy/monsterlessonsacademy/tree/144-react-comments
@TheHaribols3 жыл бұрын
@@MonsterlessonsAcademy yes I did use the correct branch..anyways I had to manually copy paste the code
@PIYUSH-lz1zq2 жыл бұрын
Sir can you bring real world questions like comments section, auto filter, folder structure...
@MonsterlessonsAcademy2 жыл бұрын
I will add it in the ideas list
@keerthanaselvan-pw5el5 ай бұрын
Great video!!
@MonsterlessonsAcademy5 ай бұрын
Glad you enjoyed it
@HeySailorman2 жыл бұрын
Amazing stuff !
@MonsterlessonsAcademy2 жыл бұрын
Glad you think so!
@yoshihirotogashi6898 Жыл бұрын
what kind of ide is this? i'm new to programming just started a month ago
@MonsterlessonsAcademy Жыл бұрын
It's Vim. Here is my video about it. kzbin.info/www/bejne/j6Ovmqidec12q80
@priyanshukhetan65383 жыл бұрын
helped a lot, thanks!
@MonsterlessonsAcademy3 жыл бұрын
Glad it helped!
@js_programmer8423 Жыл бұрын
How do you keep track of user replies..for instance, "who replied to who".. I'm working on a thread and I need it to say: "Micheal replied to Karen" but how do I keep track of who I replied to ( of a child replying to another child) ? Currently, when I'm using this comment thread and I hit reply, it just drops it under the parent root comment with no specificity to who I replied to with this one-level nest.
@MonsterlessonsAcademy Жыл бұрын
You have a parentId and userId. From parentId you can get a parent comment and userId whom you are replying.
@vijendra11502 жыл бұрын
Great Sir 🙌
@MonsterlessonsAcademy2 жыл бұрын
Thank you!
@TheSUMMIE2 жыл бұрын
Can you show how you would add a backend for this?
@MonsterlessonsAcademy2 жыл бұрын
Will add it to the list of future videos!
@MattisLinstad2 жыл бұрын
One question - I am trying to replace the static comment array in getComments and instead getting comments from my backend: export const getComments = async () => { await fetch(global.config.server.connection.url + "/Comment", { method: "GET", headers: { 'Accept': 'application/json' }, }) .then(res => res.json()) .then( (result) => { //console.log(result) return result }, (error) => { console.log("ERROR!") } ) }; But now I get an error "cannot read properties of undefined (reading filter) from const rootComments = backendComments.filter( (backendComment) => backendComment.parentId === null ); Please - what am I doing wrong?
Your array should never be undefined. It is either empty array or array with data.
@cristianopaul34282 жыл бұрын
Any tips on how to go about achieving this using vue.js and quasar ?
@MonsterlessonsAcademy2 жыл бұрын
Not really. I didn't use quasar but for vue just create 3 comps with the same logic like we did.
@mayaraoliveira70342 жыл бұрын
Are these comments saved? Or when I press F5 the page refreshes and everything disappears?
@MonsterlessonsAcademy2 жыл бұрын
No. I have a separate video for that. kzbin.info/www/bejne/sIWtq5eDpdSUbsk
@singhvimlesh2 жыл бұрын
How can I show coment according to date. I mean latest comment shows first and after that another and so on.
@MonsterlessonsAcademy2 жыл бұрын
You need to get data from the backend on already correctly sorted order.
@wafeealkevy11812 жыл бұрын
Will the comments be stored/saved?
@MonsterlessonsAcademy2 жыл бұрын
No. I have a separate video for that. kzbin.info/www/bejne/sIWtq5eDpdSUbsk
@cofing_challenge_12 жыл бұрын
Why you not use context api
@katekate57792 жыл бұрын
hm, i couldn't use your tutorial anyhow cuz there weren't any html, and it is hard to understand where and how (so css become useless as well) classes and id were set.
@MonsterlessonsAcademy2 жыл бұрын
You can find the source code with the whole markup in the description of the video
@SajalBiswas-v3g9 ай бұрын
Thank You so Much
@MonsterlessonsAcademy9 ай бұрын
You're most welcome
@mariomsumi8222 жыл бұрын
Thank you very very much
@MonsterlessonsAcademy2 жыл бұрын
You are welcome!
@rokkky192 жыл бұрын
Awesome Content!
@MonsterlessonsAcademy2 жыл бұрын
Appreciate it!
@kittichainiwongsa79832 жыл бұрын
Thank you for good video
@MonsterlessonsAcademy2 жыл бұрын
You are welcome!
@VitaliiPodhornyi10 ай бұрын
How i can join for django Rest Api, can you help me sir ?
@MonsterlessonsAcademy10 ай бұрын
I have a full video on building API for comments in nodejs. You can check that and convert it to django kzbin.info/www/bejne/sIWtq5eDpdSUbsksi=3v1r0Bz5UjK9g5B-
@aeeweb64642 жыл бұрын
Is context best in this case 43:25 ?
@MonsterlessonsAcademy2 жыл бұрын
I would not use context for such isolated and sharable module. But it's up to you
@aeeweb64642 жыл бұрын
@@MonsterlessonsAcademy Ok, You are the best thanks ♡
@akimayenasouleamidou64492 жыл бұрын
Good Job!
@MonsterlessonsAcademy2 жыл бұрын
Thanks!
@diegoguatemala5287 Жыл бұрын
you came after Jesus bro, thanks so much!
@MonsterlessonsAcademy Жыл бұрын
Glad I could help!
@diegobenitez89522 жыл бұрын
how can i hide the default comments that start without any comment my list
@MonsterlessonsAcademy2 жыл бұрын
You can remove them in api.js and just leave an empty array there.
@ShifaAfreenSiddiqui5 ай бұрын
thanks a lot for this
@ShifaAfreenSiddiqui5 ай бұрын
Just by the way, in nested comments, why is it that we cant being the user ourselves delete the parent comment without first deleting the reply.
@ShifaAfreenSiddiqui5 ай бұрын
@MonsterlessonsAcademy
@MonsterlessonsAcademy5 ай бұрын
Because in database there is a parent id reference from the child comment. If you delete parent it will lead to delete of all replies. Sure you can do it if this is what you want.
@thedyslexicwebdev1654 Жыл бұрын
1:59 data, 5:27 comments, 18:20 replies
@rushikeshharkare4183 Жыл бұрын
how we can do multiline commnet
@MonsterlessonsAcademy Жыл бұрын
What do you mean by that? It's a textarea.
@techasm09 ай бұрын
where comments are storing ?
@MonsterlessonsAcademy9 ай бұрын
As we implement only client side they are stored in variable. But I have a video which implement an API for them kzbin.info/www/bejne/sIWtq5eDpdSUbsksi=cIOW4N9PSdbVWwJ-
@mineracail42712 жыл бұрын
please how to add the @name tage in comment section
@MonsterlessonsAcademy2 жыл бұрын
I have a video about it kzbin.info/www/bejne/e3OWqWydmpuqb8U
@unpluggedaman3 жыл бұрын
Much appreciated
@MonsterlessonsAcademy3 жыл бұрын
You are welcome!
@MattisLinstad2 жыл бұрын
Awesome!!!!!!
@MonsterlessonsAcademy2 жыл бұрын
Thank you! Cheers!
@sonaldewangan31082 жыл бұрын
Thanks
@MonsterlessonsAcademy2 жыл бұрын
Welcome
@gabrielfono8442 жыл бұрын
how to bring the same logic with like button so I could count the like easily
@MonsterlessonsAcademy2 жыл бұрын
I don't really understand the question. Every time when user likes or dislikes comment you must update info in database on the amount of likes for comment
@hadiawaleh24632 жыл бұрын
please could you show us the database schema
@MonsterlessonsAcademy2 жыл бұрын
Hi Hadi, users table: id, name comments table: id, body, userId, parentId
@hadiawaleh24632 жыл бұрын
@@MonsterlessonsAcademyparentId is the user who wrote a comment, while userId is the user who replied to this comment. Is it correct?
@MonsterlessonsAcademy2 жыл бұрын
@@hadiawaleh2463 parentId is the id of the parent comment if it is not a root comment. userId is the user who created the comment.
@nsjustice6803 Жыл бұрын
Nice video
@MonsterlessonsAcademy Жыл бұрын
Thanks
@spurgeongnanprakasham2 жыл бұрын
Nice
@MonsterlessonsAcademy2 жыл бұрын
Thanks
@shantanu3919963 жыл бұрын
How to tag the user? Can you please tell? 😀
@MonsterlessonsAcademy3 жыл бұрын
What do you mean?
@tuannguyen59043 жыл бұрын
@@MonsterlessonsAcademy he mean this
@MonsterlessonsAcademy3 жыл бұрын
@@tuannguyen5904 Ahh :) Didn't get that
@MonsterlessonsAcademy3 жыл бұрын
You can't directly tag someone on KZbin anymore, but you can use the comment-reply feature to get a similar effect.
@brssnj542 жыл бұрын
@@MonsterlessonsAcademy he means how would you implement a tagging feature
@Vairadurai Жыл бұрын
super
@MonsterlessonsAcademy Жыл бұрын
Thank you
@uchung28902 жыл бұрын
This is not real-time with other user in a post , right ?
@MonsterlessonsAcademy2 жыл бұрын
Nope. It's just a React implementation for nested comments without API or sockets.
@dabbopabblo2 жыл бұрын
Lmao any youtube dev would throw a fit watching this