Sometimes there are situations where you find yourself repeating the use of components in ReactJS. At times like this it might be useful to use a component wrapper to help you out.
An example of this could be as follows:
import Modal from '@mui/core'
const ModalWrapper = (props) => {
return (
<Modal>
<Box>
{props.children}
</Box>
</Modal>
);
};
const MyComponent = () => <p>Hello World!</p>;
<ModalWrapper>
<mycomp />
</ModalWrapper>
This lets you go about creating reusable component wrappers for your individual components.
Cheers!