DEV Community

Discussion on: 🔧 Build a complete Modal Component with React Hooks 🌈

Collapse
 
haimbuchbut profile image
Haim Buchbut • Edited

When I call modal.current.open() from the onClick() handler I'm getting that modal.current is null. Any idea what could be the reason?

const ObjList = () => {

const modal = useRef(null);

return (






Hello World



...



)

}