Create A Toast Notification Component With React

  Рет қаралды 16,208

PortEXE

PortEXE

Күн бұрын

Пікірлер: 32
@alexandrurosu7724
@alexandrurosu7724 3 жыл бұрын
I came here looking to learn about toasts and ended up learning about folder structures, custom hooks, portals, refs, forward refs, imperative handle, closures some really good practices. This is an amazing tutorial, hope to see more like this in the future. Thank you!
@awuk3468
@awuk3468 3 жыл бұрын
I've been using React for a few years now, JavaScript for many, I have just realised that I have no idea how to do things properly in React! I've used state, effect, ref etc, but never used forward ref, portals, or memo, and that export in each folder makes it so much cleaner! Thanks for the video, I have learnt quite a bit from this alone.
@Moog_us
@Moog_us 3 жыл бұрын
This may be the most underrated youtube video I've seen in my life
@Ayydos
@Ayydos Жыл бұрын
Bro is a react god. This is an interview question and now I can see why.
@mickaelrichard7255
@mickaelrichard7255 3 жыл бұрын
I got scared when you say it will be a more advance app but I actually found it easier than your chat app :) Your explanations are getting better with each new video you make thanks a lot!
@musicmoi
@musicmoi 3 жыл бұрын
Very grateful of how you can easily explain more intermediate and complex concepts to such a beginner like myself. Some things went over my head, but too be expected. Overall fantastic tutorial!
@haha-eg8fj
@haha-eg8fj 2 жыл бұрын
A very good tutorial about the advanced features of React. And the useRef/useImperativeHandle/forwardRef topic is indeed alien to me. It is very tricky at the beginning and I have to go back to watch a few more times to grasp the idea of the concept and its usage.
@be2wa
@be2wa 2 жыл бұрын
Love the pace.
@cozybird724
@cozybird724 3 жыл бұрын
I was able to learn a lot from this video! Thank you!
@franciscofunes558
@franciscofunes558 3 жыл бұрын
Great idea! Looking forward to code it , always learning something new!!
@АнтонСтрока
@АнтонСтрока 3 жыл бұрын
auto close method save my work day ! thx !
@rodsmade
@rodsmade 2 жыл бұрын
if anyone's had trouble with absolute imports as I did, I found that going into package,json and modifying the start script from "start": "react-scripts start" to "start": "NODE_PATH=src react-scripts start", (adding an env variable referencing the src folder) solved the problem for me :) (also deleted the jsconfig.json file)
@soltiscd
@soltiscd 3 жыл бұрын
Really good. Very good explanation and approach. Would you consider doing something with Material-ui, yup and forms? It gets really cumbersome with styled components and when you reuse a MUIeditedconponent. Cheers!
@MightyKingKala
@MightyKingKala 2 жыл бұрын
Thank you ❤️
@mansukhkaur9494
@mansukhkaur9494 2 жыл бұрын
How can we stack toasts below each other? USE CASE : another event triggers before the previous toast has been closed. How would it appear? Edit: I just watched the whole tutorial, its there! Thank you so much!
@kaykay4130
@kaykay4130 2 жыл бұрын
great video, thankss
@justintagorda704
@justintagorda704 Жыл бұрын
What a great video, just wondering how can i implement it on other page? i need to import the toastportal on each page? because it relies on useRef per page
@rodsmade
@rodsmade 2 жыл бұрын
Hi Zack, is it actually possible to pass in the toastRef to a child component so that a toast can be created from elsewhere other than the app? i'm working with authentication and different pages and am trying to implement the One Toast Component To Rule Them All
@rodsmade
@rodsmade 2 жыл бұрын
okay i managed to implement this using Context to anyone wondering.
@arwinnandu5948
@arwinnandu5948 6 ай бұрын
@@rodsmade do you have the source code and if you do can you share it with me?
@rodsmade
@rodsmade 6 ай бұрын
@@arwinnandu5948 i don't sorry :/ i remember i followed tutorials on useContext, which sort of adds "global variables" to your application. hope this helps somehow
@nocodeandcodeph4449
@nocodeandcodeph4449 3 жыл бұрын
I love the color of the IDE, 🥰. What theme is that?
@mehdadhussain9744
@mehdadhussain9744 2 жыл бұрын
Is there any way around with out create index.js in every folder under component folder, with only one file ?, thanks a lot, great tutorial.
@danielcsmariz
@danielcsmariz 3 жыл бұрын
One thing I've missed from this tutorial is how to trigger a new toast from and app inner component since the ref is inside the App
@MarvinCollins14
@MarvinCollins14 3 жыл бұрын
am strangling with the same concept, but he mentioned you can use context api
@tienlx97
@tienlx97 2 жыл бұрын
you can use context api and wrap ref inside, or wrap all function in toast
@ariannecanlubo8038
@ariannecanlubo8038 3 жыл бұрын
Great video! btw what's your VS code theme here? :)
@PortEXE
@PortEXE 3 жыл бұрын
Laserwave
@mr.javascript1320
@mr.javascript1320 3 жыл бұрын
Amazing video....Jst LOVE YOUR CONTENT !!! if i was gay i would smooch you for making me smart
@PortEXE
@PortEXE 3 жыл бұрын
Lol! Thanks. Appreciate you.
@satindersingh9671
@satindersingh9671 2 жыл бұрын
useImperativeHandle(ref, () => ({ addToast: ({ message, mode }: ToastProps) => { const toastId = uuid(); setToasts([...toasts, { toastId, message, mode }]); 👇🏽👇🏽👇🏽👇🏽👇🏽👇🏽👇🏽👇🏽👇🏽👇🏽👇🏽👇🏽👇🏽👇🏽👇🏽👇🏽👇🏽 if(autoClose) { setTimeout(() => { setToasts((toasts) => toasts.filter((toast) => toast.toastId !== toastId)); }, 5000); } }, })); Then no need for the useAutoClose hook because setToast will receive the latest toasts from prev state. 😀 Thank you for the great video as always and please start making videos again 🙏🏼. You are the best.
Everything I Do When I Start A New React Project
16:28
PortEXE
Рет қаралды 4,9 М.
Build And Publish A React Component Library
24:02
PortEXE
Рет қаралды 105 М.
coco在求救? #小丑 #天使 #shorts
00:29
好人小丑
Рет қаралды 40 МЛН
Миллионер | 3 - серия
36:09
Million Show
Рет қаралды 2,1 МЛН
The Ultimate Sausage Prank! Watch Their Reactions 😂🌭 #Unexpected
00:17
La La Life Shorts
Рет қаралды 8 МЛН
Lazy days…
00:24
Anwar Jibawi
Рет қаралды 6 МЛН
This is the Only Right Way to Write React clean-code - SOLID
18:23
Get started with React.js & React Router 6+
3:45:30
Academind
Рет қаралды 174 М.
NextJS 13 WARNING: Easy Mistake = Infinite Loops
23:46
Jack Herrington
Рет қаралды 49 М.
Toast Notifications in Reactjs (react-toastify)
8:25
Web Dev Dev Dev
Рет қаралды 86 М.
Most Beginner React Developers Do This Wrong
13:47
Web Dev Simplified
Рет қаралды 236 М.
Build and Document React Components With Storybook
47:11
PortEXE
Рет қаралды 90 М.
They Finally Released This Toast Library
4:39
Josh tried coding
Рет қаралды 89 М.
coco在求救? #小丑 #天使 #shorts
00:29
好人小丑
Рет қаралды 40 МЛН