Closed arnabsen1729 closed 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.
ref
overlayRef
overlayEl
current
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:
Fixes: #507
The
ref
was assigned tooverlayRef
notoverlayEl
. We can access the element with thecurrent
attribute. Then applyquerySelector
.https://github.com/chinchang/web-maker/blob/ea740823da9064752a9d6fda117b10573a8d05bb/src/components/Modal.jsx#L81-L87
Final Result: