<Modal>
<Modal.Footer>
// any custom content. User can completely control behavior of this content.
</Modal.Footer>
</Modal>
export const ModalFooter = ({children}) => {
return <div className={'modal-footer'}>{children}</div>
}
.modal-footer {
// css to make footer sticky or scrollable.
}
场景是模态框的页脚将成为可选功能。仅当该人发送
最佳答案
像这样创建
const Modal = ({ children }) => <>{children}</>;
const ModalFooter = ({children}) => {
return <div className={'modal-footer'}>{children}</div>
}
Modal.Footer = ModalFooter;
export default Modal;
关于javascript - 如何在组件内制作组件?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/74989057/