React Dialogs (the right way)

  Рет қаралды 9,394

Coding in Public

Coding in Public

Күн бұрын

Пікірлер: 45
@lvekua
@lvekua Жыл бұрын
Practical and powerful. Awesome stuff Chris!
@CodinginPublic
@CodinginPublic Жыл бұрын
Glad you liked it!
@pastafarian7
@pastafarian7 11 ай бұрын
I’ve been using some regular html dialogs in a react app, and I think that does work as long as you don’t need to re-render anything while it’s open (eg I have an instructions dialog with static content that you can open and close). But if the content changes re-renders break that approach I think, at least for modal dialogs, which is what I want. Thanks for teaching me the right way to do it.
@MrTaekbeen
@MrTaekbeen Жыл бұрын
I wish I knew this sooner! Great content :)
@CodinginPublic
@CodinginPublic Жыл бұрын
Glad you enjoyed it!
@steveca057
@steveca057 Жыл бұрын
Always a huge help Chris, cheers
@CodinginPublic
@CodinginPublic Жыл бұрын
So glad to hear, my friend!
@K.Huynh.
@K.Huynh. Жыл бұрын
Thank for shaing! I will try this.
@CodinginPublic
@CodinginPublic Жыл бұрын
Have fun!
@_ash64
@_ash64 Жыл бұрын
Will try this out Chris!
@Pareshbpatel
@Pareshbpatel 10 ай бұрын
React Dialogs that use the Dialog HTML Element, so clearly explained. Thanks, Chris. {2024-03-20} - Subscribed! , {2024-03-22}
@CodinginPublic
@CodinginPublic 10 ай бұрын
Glad it was such a help!
@7doors847
@7doors847 Жыл бұрын
Very helpful. Looking forward to the Astro course. Could you do a video on Astro 4.0 sharing your thoughts?
@CodinginPublic
@CodinginPublic Жыл бұрын
Astro course is live (well, early access is live) here: learnastro.dev! I may still do a 4.0 video. There's not a lot user-facing, so I didn't. My guess is I'll do individual videos on the features :)
@OrcanArtz
@OrcanArtz 7 ай бұрын
Absolute hero!
@CodinginPublic
@CodinginPublic 7 ай бұрын
Glad you liked it!
@kafin3504
@kafin3504 6 ай бұрын
Great videos! Thanks for making this! btw does this dialogue element is more superior than react portal?
@CodinginPublic
@CodinginPublic 6 ай бұрын
I wouldn't say superior, but anytime I can use native elements, I prefer them because they're built-in and accessible by default. Something as established as React portal will be good, too, but I just prefer to use the web platform when it's an option.
@trollocat
@trollocat 4 күн бұрын
excellent
@artem_zakharchuk
@artem_zakharchuk Жыл бұрын
Cool explanation!) Thank you) But you forgot to explain how useImperativeHandle relates to the dialog)
@CodinginPublic
@CodinginPublic Жыл бұрын
Hmm…I haven't heard of that? Is that built into React?
@godofwar8262
@godofwar8262 Жыл бұрын
Thank for react video 🎉
@CodinginPublic
@CodinginPublic Жыл бұрын
You’re welcome! Hope it was a help!
@sweetink4453
@sweetink4453 Ай бұрын
Yeah, that was great video
@CodinginPublic
@CodinginPublic Ай бұрын
Glad you enjoyed it
@matheuspombeiro1675
@matheuspombeiro1675 9 ай бұрын
Thank you very much
@CodinginPublic
@CodinginPublic 9 ай бұрын
You’re welcome!
@sweetink4453
@sweetink4453 Жыл бұрын
That was great video
@CodinginPublic
@CodinginPublic Жыл бұрын
So glad you enjoyed it!
@dojoisdead
@dojoisdead 9 ай бұрын
Omg ty so much!
@CodinginPublic
@CodinginPublic 9 ай бұрын
You’re welcome!
@alisherzaitov
@alisherzaitov Жыл бұрын
Hey Chris! So cool you’ve finished your course, insta purchase. However I would’ve missed it if I had not check a spam folder. An announcement on the channel will be handful. Also the link in the channel info tab will be useful (cause since that was a letter from the spam folder I wanted to find a legit link on your channel, found it under one of the videos dedicated to Astro.) I’ll send you a feedback on the course soon🫶
@CodinginPublic
@CodinginPublic Жыл бұрын
Good feedback, thanks! I don't want to spam everyone constantly about the course, but I do have some idea for future promotion of the course. Thanks for the feedback. Hope you love the course!
@alisherzaitov
@alisherzaitov Жыл бұрын
@@CodinginPublic love it already, you are teaching in a right pace.. right for me.
@pinholeopinho
@pinholeopinho 7 ай бұрын
Thank you!!!!!!!!!!!!!!!!!!!!!
@CodinginPublic
@CodinginPublic 7 ай бұрын
You're welcome!!
@sashaBejenari
@sashaBejenari 11 ай бұрын
Thx!
@CodinginPublic
@CodinginPublic 11 ай бұрын
You’re welcome!
@santiago.dev96
@santiago.dev96 5 ай бұрын
Why would you need access to the dialog DOM element ref? Isn't just better to have the ref defined directly in the Dialog component and use a prop to open/close the dialog for all the components that want to use the Dialog component in their return value? I think that having direct access to the ref in the parent component is kind of useless.
@davidc872
@davidc872 3 ай бұрын
you need to close the dialog in the parent component (where the buttons are defined) so the parent component needs to have access to the ref so it can use it in the toggleDialog function, so no you can't define the ref or the toggleDialog in the dialog component because the parent component that renders this dialog needs to have access to it.
@skl9942
@skl9942 2 ай бұрын
The dialog functions, showModal() and close() are not only toggling open on the dialog element. You dont get the same functionality with a isOpen prop
@kyung.lee.official
@kyung.lee.official 10 ай бұрын
This might not be the "right way". If you have states in a dialog, you probably want to clear them after closing it -- setting states to the default values one by one before calling the"close" function is ugly. I know what you're thinking, use a state to destroy the dialog, like "showDialog && ", unfortunately this will cause the dialog not showing up on iPhone😢, it works perfectly on Windows and Android though.
@MikeMcElroy
@MikeMcElroy 8 ай бұрын
This is the first mention I've seen of anyone even trying conditional rendering of the dialog element, and why it might be problematic. Is there any more information on it? Like, what causes this particular problem for iPhone? Is it documented anywhere? I personally hate `ref`s, so I'm surprised to see everyone using them to manage their modal when they could just be using conditional rendering. I guess I'll find out as I try to develop my own dialog element modal implementation in React without refs.
@DioArsya
@DioArsya Жыл бұрын
Never Forget React forwardRef Again
9:33
Coding in Public
Рет қаралды 25 М.
This is the Only Right Way to Write React clean-code - SOLID
18:23
coco在求救? #小丑 #天使 #shorts
00:29
好人小丑
Рет қаралды 120 МЛН
When you have a very capricious child 😂😘👍
00:16
Like Asiya
Рет қаралды 18 МЛН
The HTML Tags They NEVER Taught You
7:39
Giodev
Рет қаралды 158 М.
Build a Dark Mode without a White Mode Flash!
23:17
Coding in Public
Рет қаралды 5 М.
Finally Fix Your Issues With JS/React Memory Management 😤
20:13
Jack Herrington
Рет қаралды 90 М.
The Most Important Design Pattern in React
35:04
Cosden Solutions
Рет қаралды 128 М.
Why Signals Are Better Than React Hooks
16:30
Web Dev Simplified
Рет қаралды 500 М.
Build Navbar Menus That Actually Work for Everyone
17:07
Coding2GO
Рет қаралды 25 М.
React Query Is (Still) Essential - My Favorite React Library
11:04
Theo - t3․gg
Рет қаралды 162 М.
This Folder Structure Makes Me 100% More Productive
24:36
Web Dev Simplified
Рет қаралды 127 М.
coco在求救? #小丑 #天使 #shorts
00:29
好人小丑
Рет қаралды 120 МЛН