Skip to content

Add support for dialogs without having to use a view model #962

@einari

Description

@einari

In addition to the useDialogRequest hook, it would be nice to have a useDialog hook as well.

For instance:

export const MyView = () => {
   const [dialog, showDialog, closeDialog] = useDialog(DialogComponent);
   return (
       <>
           <button onClick={() => showDialog()} />
           <dialog input={42}/>
       </>
   );
};

The dialog that is returned should be a wrapper for the actual dialog that deals with the visibility of it. It would then be nice to let it represent the props type of the actual dialog, so that one can use props/attributes as input - instead of the request approach for the MVVM version.
What we also do need is the capability of returning data from the dialog as we have with the MVVM version.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions