MCPcopy Create free account
hub / github.com/primer/react / useConfirm

Function useConfirm

packages/react/src/ConfirmationDialog/ConfirmationDialog.tsx:184–194  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

182 * resolved with `true` or `false` depending on whether or not the confirm button was used.
183 */
184export function useConfirm() {
185 const {theme, colorMode, dayScheme, nightScheme} = useTheme()
186 const result = useCallback(
187 (options: ConfirmOptions) => {
188 const themeProps: ThemeProviderProps = {theme, colorMode, dayScheme, nightScheme}
189 return confirm(themeProps, options)
190 },
191 [theme, colorMode, dayScheme, nightScheme],
192 )
193 return result
194}

Callers 3

ShorthandHookFunction · 0.90

Calls 2

useThemeFunction · 0.90
confirmFunction · 0.85

Tested by 1