Skip to content

Blog

V3.0.0 has been released

Version 3.0.0 for React Dialog Async has been released 🎉

React Dialog Async started out as a small library for personal use, first published over 4 years ago. At the time I was focused on a small set of features for solving my own personal use case. While it’s grown to support more projects, the core API has remained largely unchanged since day one.

In retrospect, theres a few design decisions that could have been made better - but until now I’ve held off making any breaking changes in favour of stability. Now feels is the right time to pay down some technical debt and bundle all of the breaking changes together into a newer, more polished version of the library.

  • New useDialogLazy() hook that supports bundle splitting dialogs. Read the docs here, or check out the API reference.

  • New <StaticDialog/> component for rendering dialogs created for useDialog() statically in JSX. API reference

There are a number of breaking changes in this release. Please read the migration guide for more details.


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

V2.5.0 has been released

Version 2.5.0 for React Dialog Async has been released 🎉

  • Dialogs are now wrapped in a provider that exposes all of the props passed to the dialog component via react context. Call useDialogContext from a component inside a dialog to access all the dialog props such as open, data, and handleClose. Read more about useDialogContext.

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

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.