[Code Demo] create Modal System with Context API in React | JSer - Front-End Interview questions

preview_player
Показать описание
How to create a Modal System in React?

React Portals might be good but personally I'd like to separate the Modals from Screens, because the order information is not fixed for a modal, yet push and pop actions have the order info naturally.

Hope it helps.

Hi I'm a JavaScript engineer who is not good at algorithms,
and currently practicing leetCode & BFE.dev. If you are interested, maybe we can learn together.
Рекомендации по теме
Комментарии
Автор

Nice video.
The problem I have is, when I pass a modal with state (like a form with input), the state does not update when I'm typing in the input in the modal. Any idea why and how to solve the problem?

Thanks :)

Автор

How can you add a working textbox to one of the modals, that will send data to the parent?

cecilcarter