Skip to content

Blog

Deprecating show/hide in favour of open/close

As of the next major release (3.0.0), the show() and hide() methods of useDialog() will be deprecated in favour of open() and close(). There is currently no set date for this release, but we wanted to give you a heads up so you can migrate ahead of time

The naming of “show” and “hide” imply that the dialog always exists, and is just being shown and hidden. This is misleading, and doesn’t accurately reflect how the library works. Dialogs are created and destroyed every time they’re opened, ensuring that they have clean state to prevent issues with stale state that arise especially when using forms or other stateful components within dialogs.

Nothing, yet. There is no set date for the next major release, and it will likely be some number of months away. That being said, you can start migrating your code now, as the new methods are already available in the current version of the library and follow the exact same API & implementation as the old methods.

const myDialog = useDialog(MyDialog);
await myDialog.show(...);
await myDialog.open(...);
await myDialog.hide();
await myDialog.close();

Feedback or ideas? We’d love to hear them! Open an issue over on GitHub.

V2.4.0 has been released

Version 2.4.0 for React Dialog Async has been released 🎉

  • Dialog components are now passed a focused prop. This is a boolean indicating if the dialog is “focused” or not. This is useful for handling cases where multiple dialogs are open at the same time.
  • Added deprecation warnings for show() and hide() methods on useDialog(). These methods will be removed in the next major release. Read more here
  • Added a deprecation warning for the mounted prop passed to dialog components. This prop will be removed in the next major release

Feedback or ideas? We’d love to hear them! Open an issue over on GitHub.

V2.3.0 has been released

Version 2.3.0 for React Dialog Async has been released 🎉

  • Introduces a new option that can be passed to useDialog; hideOnHookUnmount. This option allows you to prevent dialogs being hidden when useDialog() unmounts, which is useful if you want to show a dialog from a toast or other short-lived component. (More details)

Feedback or ideas? We’d love to hear them! Open an issue over on GitHub.

V2.2.0 has been released

Version 2.2.0 for React Dialog Async has been released 🎉

This release introduces the DialogOutlet component for solving issues with nested providers!

  • Previously, dialogs were rendered as direct children of the DialogProvider. Now you can use a DialogOutlet to instead render dialogs in a different place in the component tree (More details)
  • Internal performance optimisations

Feedback or ideas? We’d love to hear them! Open an issue over on GitHub.

V2.1.0 has been released

Version 2.1.0 for React Dialog Async has been released 🎉

This release brings configurable options for useDialog to support default data and animations!

  • useDialog now accepts a secondary argument for config options (More details)
  • Animation support - you can now delay dialog unmounting to allow time for animations to complete (More details)
  • Default data for dialogs - you can now specify default data for dialogs (More details)
  • Internal performance optimizations

Feedback or ideas? We’d love to hear them! Open an issue over on GitHub.