iTwin / iTwinUI-react

A react component library for iTwinUI.
https://github.com/iTwin/iTwinUI
Other
83 stars 23 forks source link

fix(ModalButtonBar, ModalContent): Wrap `DialogButtonBar` and `DialogContent` instead of directly assigning #961

Closed mayank99 closed 1 year ago

mayank99 commented 1 year ago

I was testing some build improvements to storybook when I started getting this error:

DialogButtonBar is not defined

Investigating it, I found that docgen was trying to use DialogButtonBar. But DialogButtonBar and DialogContent are not exported (they get exposed as subcomponents of Dialog, like Dialog.ButtonBar, etc) so it could not find it.

To fix this, instead of directly assigning DialogButtonBar to ModalButtonBar and DialogContent to ModalContent, I am now creating a wrapper component over it. I would imagine this would potentially fix some similar issues on the user's side too.

mayank99 commented 1 year ago

We are assigning Avatar to UserIcon. Could this have similar problem?

UserIcon is exported so it should be fine. And I didn't get any other errors in the storybook change I was testing.