Can you please give me all the react installations starting from the initial setup. Nice video was great help
@adrielomalleyАй бұрын
useful video you should do more!
@Abil15Ай бұрын
Bro nice can you send me the video link for ssl certification for website
@noobie379Ай бұрын
Where is the source code?
@stanislavdidenko8436Ай бұрын
thanks for turorial, though. It is weird it worked for you in sequential manner always. For me not. Basically state update is asyncronous. So you likely to send to the socket a non-updated chat function addMessage(chat){ const newChat = {...chat , user:localStorage.getItem("user") , avatar} addToFirrebase(chat) setChats([...chats , newChat]) sendChatToSocket([...chats , newChat]) }
@stanislavdidenko8436Ай бұрын
Let's analyze the relevant parts of the tutorial code you provided, focusing on the addMessage function and the related socket handling, and address why it might have worked without the functional update pattern: Key Parts of the Code State Initialization: javascript const [chats, setChats] = useState([]); Sending a Message: javascript function addMessage(chat){ const newChat = {...chat , user:localStorage.getItem("user") , avatar} addToFirrebase(chat) setChats([...chats , newChat]) sendChatToSocket([...chats , newChat]) } Why It Might Have Worked Timing and User Interaction: If users are not sending messages in rapid succession, the state chats may have the expected value at the time sendChatToSocket([...chats, newChat]) is called. This means that even without using the functional update form, it worked because the updates happened in a way that maintained the expected state context. Batching of Updates: React's batching behavior allows multiple state updates to be handled more efficiently. If the state change happens due to a user action (like clicking a button), React batches those updates. If there is a slight delay or pause after one message is sent before another message is sent, the chats state may have updated in between calls, making it appear as if the non-functional pattern worked. Single User Context: In a simple scenario with a single user interacting with the chat, the likelihood of encountering race conditions is lower. If there’s only one source of updates (the user), it can create a sequential appearance. The Problem with the Current Approach While it might seem to work, the approach is fragile for a couple of reasons: Stale State Issue: If you were to implement a feature where multiple messages could be sent rapidly (e.g., pressing the "send" button multiple times), the chats array might not reflect the newly added message when the socket emits the chat. Lack of Predictability: As the application grows, maintaining state with a non-functional approach can lead to unpredictable bugs, especially when more components depend on the same state. Recommended Fix To ensure the latest state is used, you should adopt the functional update pattern, which ensures that you always work with the latest state: javascript function addMessage(chat) { const newChat = { ...chat, user: localStorage.getItem("user"), avatar }; addToFirrebase(chat); // Add to Firebase setChats((prevChats) => { const updatedChats = [...prevChats, newChat]; // Use the latest state sendChatToSocket(updatedChats); // Emit the updated chats return updatedChats; // Update the state }); }
@urbanpuma9136Ай бұрын
Thanks. How to solve the issue from the front end if sending request to remote server?
@ghazal.muayad.alotaibi2013Ай бұрын
Is this english or computer??
@JahidHasan-zl7omАй бұрын
how can i make it automatic run whever PC starts
@adithvijay23952 ай бұрын
Shit contet dint watch
@jayshah82712 ай бұрын
how to debug the code please do the video on it N
@kevaltank62922 ай бұрын
is it free forvever or it's paid after a certain trail time
@bjgjuiuguoojpoo2 ай бұрын
Learn how to make tutorials, because 20 minutes go by and you're fiddling with styling and still making basic mistakes! If you are making a tutorial about sending emails, make it about that, not about how to play with css!
@Vivekpatel-hh7sr2 ай бұрын
use normal keyboard, it is disgusting voice, i have to skip watch this video i will find another chat video. thank you before uploading video first you have to check the video.
@notheory-norules59152 ай бұрын
a video that could be shortened to 2 mins -- of useful information -- talking tooooo much
@rohit369103 ай бұрын
Thank you so much 🙏
@matthealy71803 ай бұрын
this video is excellent. thank you for this. is it up-to-date though? i am trying to insert a breakpoint as per around 6:25 but no dice :( very possible that im doing it wrong
@matthealy71803 ай бұрын
nvm i found the problem. i was trying to insert a breakpoint where one wasnt valid. i would delete this comment so that i dont look stupid but i want to increase your engagement for the SEO. happy coding :)
@NarasimhaRaju-y9i3 ай бұрын
nginx does show in my public ip after installation it shows "This site can’t be reached 13.201.137.0 refused to connect." and 22,80,443 all ports are available in security group please help
@JonasKr.3 ай бұрын
very useful tutorial.. thanks a lot man
@Satya-o3s3 ай бұрын
what u down load to push download
@everythingjdm80573 ай бұрын
great video man
@1111ah3 ай бұрын
Great video. Thanks!
@witelfortgelin53773 ай бұрын
Hi sir! I need a dev like you to learn me mern stack web application on aws, how I can enter in contact with you pls?
@AnupumPant3 ай бұрын
How do i configure nginx if my other app is running on other port simultaneously.
@Zohan05023 ай бұрын
use good microphone the explanation is good
@JestinaNJones3 ай бұрын
Kindly help with the debug(er) video pls.
@legendary53203 ай бұрын
Great video. Clear concise and to the point.
@Natefuller83 ай бұрын
Super helpful even one year later! Excellent tutorial style very easy to follow.
@DmitriZaitsev4 ай бұрын
Pls use timecodes
@prezlamen4 ай бұрын
Thank you for zoom!!! Easy to see for everybody.
@awaraamin68504 ай бұрын
Thank you so much sir
@ruqayahn.k46454 ай бұрын
good thanks
@techybhoot4 ай бұрын
your video was amazing helped me to deploy my project thank you very very much
@rkvcherry55354 ай бұрын
What about that pm2 when i deploy in render ...m Does it even run as expected without changing anything
@HuyNguyen-en4pr4 ай бұрын
Thank you so much. I was struggling so much to figure out how to just deploy my backend api to heroku and i kept getting error after error after error. I came across your video and now it finally works. You are a life saver!
@Aravindh143s4 ай бұрын
bruh just installing PM2 that's it? there is no any setup in package.json file or anywhere? i mean modifications like for jest
@sanketemala11184 ай бұрын
literally the best video on this error, solves all the problem while giving all the information
@Lorenzo-ky6yz4 ай бұрын
Great video my fellow South African.
@angelozorn97404 ай бұрын
fantastic video thank you!
@hihello262624 ай бұрын
bro is goated
@rontheprogrammer4 ай бұрын
thanks man
@doniyorbekmaksudov46165 ай бұрын
It didn`t work!
@Ntrleye5 ай бұрын
Yo What if, im using VITE?
@briwaysol5 ай бұрын
But it’s not free
@thechoosen42405 ай бұрын
Good job bro, JESUS IS COMING BACK VERY SOON; WATCH AND BE PREPARED
@abuasim10005 ай бұрын
You started beautifully, but started just pasting the codes for your convenience. this is not a useful tutorial who don't know about dnd. It appears you are teaching yourself.