DEV Community

Discussion on: My secret trick for writing great React components

Collapse
 
victorocna profile image
Victor Ocnarescu

I use a generic modal component like the modal from the react-bootstrap package and I customize it by writing new modals in separate files.

Something like this:

const ConfirmModal = ({ isOpen, hide }) => {
  return (
    <Modal centered backdrop="static" show={isOpen} onHide={hide}>
      <h2>hello world</h2>
    </Modal>
  );
};
Enter fullscreen mode Exit fullscreen mode