Тёмный

Mock interview for SDE 1 in Product based company | react js | EP - 17 

Chirag Goel
Подписаться 27 тыс.
Просмотров 6 тыс.
50% 1

Опубликовано:

 

12 сен 2024

Поделиться:

Ссылка:

Скачать:

Готовим ссылку...

Добавить в:

Мой плейлист
Посмотреть позже
Комментарии : 38   
@indrajbirsingh7047
@indrajbirsingh7047 20 дней назад
Thanks chirag for having me. It was a great learning experience😊
@dilshadazam880
@dilshadazam880 19 дней назад
Paaji you did great. The way you picked up the hints was really awesome. You maintained your composure quite well
@rohitsingh-xj1ey
@rohitsingh-xj1ey 15 дней назад
Great work bro well done 💯
@ShankarKumar-dg6pe
@ShankarKumar-dg6pe 20 дней назад
Thank you for the video 👍. That parent container for top values is very nice trick 👍. Complete Solution by me: function Toast({ id, text, onClose, timer = 10 }) { const [count, setCount] = useState(timer); const timerRef = useRef(null); const parentRef = useRef(document.querySelector(".toast-container")); if (!parentRef.current) { const el = document.createElement("div"); el.classList.add("toast-container"); document.body.appendChild(el); parentRef.current = el; } useEffect(() => { timerRef.current = setInterval(() => { setCount((prev) => prev - 1); }, 1000); return () => { clearInterval(timerRef.current); }; }, []); useEffect(() => { if (count { onClose(id); clearInterval(timerRef.current); }; return createPortal( {id} {"=>"} {text}-{count} x , parentRef.current ); } function App() { const [toasts, setToasts] = useState([]); const closeToast = (id) => { setToasts((prev) => prev.filter((t) => t.id !== id)); }; const addToast = () => { setToasts((prev) => [ ...prev, { id: prev.length + 1, text: "I am toast", onClose: closeToast, timer: 20, }, ]); }; const handleClick = () => { addToast(); }; return ( Show Toast {toasts.map((toast) => { return ; })} ); }
@temochnu
@temochnu 19 дней назад
Yes it's really good video, keep bringing more videos like this
@Atulkumar-te4rt
@Atulkumar-te4rt 19 дней назад
Really nice video Chirag, Loving the content more day by day 😍
@spandanbanerjee9449
@spandanbanerjee9449 17 дней назад
Hi Chirag. It would be great if you could upload the full question with all the subtasks. Would be easier for us to practice and follow along. And thanks a lot for these videos. Super helpful.
@dilshadazam880
@dilshadazam880 20 дней назад
Just stopped in between to give another comment. Loving it Chirag. Please bring more such interview questions
@engineerchirag
@engineerchirag 20 дней назад
Thank you ❤️🚀
@codewithjayminn
@codewithjayminn 20 дней назад
Thank you for this interview
@Aviralsingh-yw7xx
@Aviralsingh-yw7xx 20 дней назад
Thanks Chirag Sir. It is much needed
@engineerchirag
@engineerchirag 20 дней назад
Keep watching 🚀
@user-cm9gs2we3u
@user-cm9gs2we3u 11 дней назад
Can we do it with lib react -toastify?
@fitnessforlifetamil3936
@fitnessforlifetamil3936 20 дней назад
very informative sir
@engineerchirag
@engineerchirag 20 дней назад
Thank you 🙏
@sachinaggarwal9952
@sachinaggarwal9952 20 дней назад
Very informative Chirag!
@engineerchirag
@engineerchirag 20 дней назад
❤️🙏
@hatimtekri4949
@hatimtekri4949 20 дней назад
interesting Chirag
@hatimtekri4949
@hatimtekri4949 19 дней назад
Hi Chirag, i also want participate in this mock interview video, if you want then we can schedule it on some weekends
@3MBSUPERDUDE
@3MBSUPERDUDE 19 дней назад
@@hatimtekri4949 maqsad jarur puri hogi bhaijaan
@nileshdeshmukh7841
@nileshdeshmukh7841 20 дней назад
Hii sir, very informative video, but thumbnail of video , can be little improved
@engineerchirag
@engineerchirag 20 дней назад
Hey, any suggestions to improve the thumbnail 😊
@sachintambeshwar9712
@sachintambeshwar9712 20 дней назад
what was the issue in that why all toast are disappearing ?anyone knows?
@temochnu
@temochnu 19 дней назад
Actually the parent div should be fixed from top and right after that child div toast should be relative.
@JeevanTV-do2hc
@JeevanTV-do2hc 19 дней назад
​@@temochnu so this is css issue?
@temochnu
@temochnu 19 дней назад
@@JeevanTV-do2hc yes
@temochnu
@temochnu 19 дней назад
@@JeevanTV-do2hc mainly that only
@foodyfutsion
@foodyfutsion 19 дней назад
import { useEffect, useRef, useState } from "react"; import "./App.css"; const Toast = ({ id, text, removeToastHandler, time }) => { const [timer, setTimer] = useState(time); const interval = useRef(null) useEffect(() => { if (!interval.current) { interval.current = setInterval(() => { setTimer((prev) => { if (prev == 1) { clearInterval(interval.current); removeToastHandler(id); } else { return prev - 1; } }); }, 1000); } return () => clearInterval(interval); }, [interval]); const closeToastHandler = (id) => { clearInterval(interval.current); removeToastHandler(id); } return ( {text} closeToastHandler(id)}>X Disappears in {timer} secs ); }; const ToastContainer = ({ toasts, setToasts }) => { const removeToastHandler = (id) => { setToasts((prev) => { const filteredToasts = prev.filter((toast) => toast.id != id); return filteredToasts; }); }; return ( {toasts.map((toast) => { return ( ); })} ); }; export default function App() { const [toasts, setToasts] = useState([]); const addToast = () => { const id = `${Date.now()}`; const toastObj = { id, text: `Added new toast with ID: ${id}`, time: 10, // in secs }; setToasts((prev) => [...prev, toastObj]); }; return ( addToast()}>Show Toast ); } It does handle that "Disappearing of all toasts" problem but definitely many improvements yet to be done.
@vkkumar7146
@vkkumar7146 20 дней назад
2 minut ka kam 1 Ghanta Laga Diya😂 vah Bhi Kiya Nahin
@avinashdhar18
@avinashdhar18 19 дней назад
Aap 2 min meh kar doge?? Commenting is easy I guess
@dilshadazam880
@dilshadazam880 20 дней назад
Wow chirag great way to ask to subscribe.
@engineerchirag
@engineerchirag 20 дней назад
😂😜
Далее
A small kitten was dumped #cat #kitten #cutecat
00:41
How Strong is Tin Foil? 💪
00:26
Просмотров 48 млн
3 Years Experienced React Interview
1:16:16
Просмотров 32 тыс.
A small kitten was dumped #cat #kitten #cutecat
00:41