Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

react-dialogs-container

Package Overview
Dependencies
Maintainers
1
Versions
24
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

react-dialogs-container

Lightweight hooks ready dialogs management

  • 1.4.0-2
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
44
increased by46.67%
Maintainers
1
Weekly downloads
 
Created
Source

react-dialog-container

Library for manage dialogs inside application

Setup:

  • Place DialogsProvider over your application
  • Place DialogsContainer inside your application

Example to use

const App = () => {
  const { pushDialog } = useDialogsContainer();

  return (
    <button onClick={() => pushDialog(ModalComponent, { taste: "So tasty" })}>
      Open Modal
    </button>
  );
};

const Root = () => (
  <DialogsProvider>
    <App />
    <DialogsContainer />
  </DialogsProvider>
);

API

Hooks

useDialogsContainer
pushDialog(component, props): number - push new dialog component, return dialog identificator
closeDialogByID(dialogID) - close dialog by identificator
useDialog - return methods base on inherited context
closeDialog - fucntion to close dialog

Example usage on CodeSandbox

Edit Example usage of react-dialogs-container

Keywords

FAQs

Package last updated on 03 May 2022

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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc