Wondering what’s next for npm?Check out our public roadmap! »

    @rcp/c.prompt
    TypeScript icon, indicating that this package has built-in type declarations

    1.0.3 • Public • Published

    @rcp/c.prompt

    NPM version NPM Downloads

    Advanced React router prompt support beforeunload

    Installation

    npm install @rcp/c.prompt react-router
    # or use yarn
    yarn add @rcp/c.prompt react-router

    Usage

    import Prompt, { PromptProvider } from '@rcp/c.prompt'
    
    render(
      <PromptProvider>
        <Prompt when={true} message="Prompt Tips" />
      </PromptProvider>
    )
    
    // 自定义 Prompt 弹窗视图
    render(
      <PromptProvider
        getPromptComponent={({ message, close }) => <Modal onOk={() => close(true)} onCancel={() => close(false)} />}
      >
        <Prompt when={true} message="Prompt Tips" />
      </PromptProvider>
    )

    API

    Authors

    This library is written and maintained by 余聪, yucong06@meituan.com.

    License

    MIT

    Install

    npm i @rcp/c.prompt

    DownloadsWeekly Downloads

    5

    Version

    1.0.3

    License

    MIT

    Unpacked Size

    38.6 kB

    Total Files

    20

    Last publish

    Collaborators

    • avatar