Closed mayank99 closed 4 weeks ago
Superseded by #1983
The ref
solution may feel more "react-y" but introduces difficulties:
null
because we cannot run custom code during initializationtypeof Dialog.Ref
useImperativeHandle
apparently needs to be defined to be defined for every single component, even for simple wrappers. (I couldn't even get the ref to work with Modal so far.)
Changes
This extends the Dialog's
ref
usinguseImperativeHandle
to addshow()
/close()
methods.Usage:
Testing
Added unit test, updated stories.
Docs
Added docs.