Skip to content

Instantly share code, notes, and snippets.

@SafaElmali
Created September 18, 2021 15:35
Show Gist options
  • Save SafaElmali/81f3ce1fcf033ce556761cbbe01ceafd to your computer and use it in GitHub Desktop.
Save SafaElmali/81f3ce1fcf033ce556761cbbe01ceafd to your computer and use it in GitHub Desktop.
import "../styles/modal.css";
const ModalWithoutPortal = ({ isOpen, setIsOpen, productName = "" }) => {
if (!isOpen) return null;
return (
<div className="modal-container">
<div className="modal-header">
<h1>{productName}</h1>
</div>
<button onClick={() => setIsOpen(false)}>Close modal</button>
</div>
);
};
export default ModalWithoutPortal;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment