chinchang / web-maker

A blazing fast & offline frontend playground
https://webmaker.app
MIT License
2.55k stars 314 forks source link

v5: Fix Type-Error on opening Modals #508

Closed arnabsen1729 closed 2 years ago

arnabsen1729 commented 2 years ago

Fixes: #507

The ref was assigned to overlayRef not overlayEl. We can access the element with the current attribute. Then apply querySelector.

a reference to the node becomes accessible at the current attribute of the ref. Source: https://reactjs.org/docs/refs-and-the-dom.html#accessing-refs

https://github.com/chinchang/web-maker/blob/ea740823da9064752a9d6fda117b10573a8d05bb/src/components/Modal.jsx#L81-L87

Final Result:

image