looker-open-source/components

Dialog Component Feedback

Closed this issue · 1 comments

Trying to use example in the dialog page, on 0.9.30:
const { open, dialog } = useDialog({ content: 'My Neat Dialog' })

This results in an error: "Property 'open' does not exist on type 'UseDialogResponse'."

Additionally, https://components.looker.com/components/dialogs/#hook-usedialog is a broken link (the link is in the sidebar)

Apologies for that - the web site is out of date (we currently working with the ops team to get it updated and hopefully very soon, fully-automating the updates).

You can see the corrected version at:
https://github.com/looker-open-source/components/blob/main/www/src/documentation/components/dialogs/index.mdx#hook-usedialog

TLDR is:

Should do the trick. setOpen is the correct callback.

const { dialog, setOpen } = useDialog({ content: 'My Neat Dialog' })