简体   繁体   English

在 Vercel 和模态 window 上使用 ChackraUI 部署 React 站点停止显示

[英]Deploing React site with ChackraUI on Vercel and modal window stopped showing

I have a page with a modal window.我有一个带有模态 window 的页面。 In development mode, it opens.在开发模式下,它会打开。 But when I upload my React App to vercel, then the screen just darkens there, and the modal window does not appear, but all the window controls work.但是当我将我的 React 应用程序上传到 vercel 时,那里的屏幕只是变暗了,模式 window 没有出现,但是所有 window 控件都可以工作。 Who faced the same problem?谁遇到了同样的问题?

const { isOpen, onOpen, onClose } = useDisclosure()
  return (
    <>
      <Button onClick={onOpen}>Open Modal</Button>

      <Modal isOpen={isOpen} onClose={onClose}>
        <ModalOverlay />
        <ModalContent>
          <ModalHeader>Modal Title</ModalHeader>
          <ModalCloseButton />
          <ModalBody>
            <Lorem count={2} />
          </ModalBody>

          <ModalFooter>
            <Button colorScheme="blue" mr={3} onClick={onClose}>
              Close
            </Button>
            <Button variant="ghost">Secondary Action</Button>
          </ModalFooter>
        </ModalContent>
      </Modal>
    </>
  )

I was able to fix this by upgrading the "framer-motion": version -> "framer-motion": "^4.1.16" .我可以通过升级"framer-motion": version -> "framer-motion": "^4.1.16"来解决这个问题。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM