Thanks for bringing this up! When we call showFlag() the Flag component actually includes a close button by default, so it’s always closable even if we don’t explicitly call close(), i.e:
So either there is no button to call onClose action with an info type flag or that isAutoDismiss removes the button by default. In which case, the original question is still valid.
How can we call the Flag object close() method when we need to pass it to the function that returns it.
Edit: I just found out that the closing button disappear because of the theme change from the appearance property. If you completely omit the appearance property, you get what is shown in the screenshot. Also, in the documentation the appearance property says it makes the flag bold but the options are the exact same as type. type property should instead be mandatory and appearance should be something like isBold: boolean. Furthermore, if you set type and appearance to something different, only appearance is considered meaning that having the option to set both is useless.