Simple dialogs manager based on rxjs
--
import { DialogContainer } from "react-dials";
// render anywhere in your app
<DialogContainer default />
Then, you can create dialogs from anywhere in your app !
import { dialog } from "react-dials";
const myDialog = dialog(<div className="modal" onClick={myDialog.close}>Hello world !</div>);
This stylesheet is pretty simple, and you can create your own style instead of importing it !
import "react-dials/dist/index.css";
// render anywhere in your app
<DialogContainer default />
<DialogContainer id="anotherContainer" />
const myDialog = dialog(<div className="modal" onClick={myDialog.close}>Hello world !</div>); // will render in the default container
const mySecondDialog = dialog(<div className="modal" onClick={mySecondDialog.close}>Hello world !</div>, { container: "anotherContainer" }); // will render in the second container
MIT © pierrecabriere