Socket
Book a DemoInstallSign in
Socket

vvmodal

Package Overview
Dependencies
Maintainers
1
Versions
7
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

vvmodal

<samp>vvmodal</samp>

latest
npmnpm
Version
1.4.3
Version published
Maintainers
1
Created
Source

vvmodal version

使用 Context 来管理 Modal

下载使用

文档地址

npm i vvmodal

最简单的使用方法

import { antdModal, createGlobalModal, useModal, VVModalProvider } from "vvmodal";
import { Button, Modal } from "antd";

const Modal = createGlobalModal(() => {
  const modal = useModal();
  return (
    <Modal {...antdModal(modal)}>
      使用vvmodal管理modal状态
    </Modal>
  )
})

function App() {
  return (
    <VVModalProvider>
      <Button onClick={() => Modal.show()}>点击展示</Button>
    </VVModalProvider>
  )
}

灵感来自于nice-modal-react

FAQs

Package last updated on 31 Jan 2023

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts