Skip to content

Commit

Permalink
fix(DialogCheckbox): prevent some potential issues in dialogcheckbox
Browse files Browse the repository at this point in the history
  • Loading branch information
AAGaming00 committed Oct 11, 2024
1 parent e965816 commit bf58e08
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/components/DialogCheckbox.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,13 +20,14 @@ export interface DialogCheckboxProps extends DialogCommonProps, FooterLegendProp

// Do not access KeyDown, SetChecked, Toggle here as they are getters and accessing them outside of a render breaks them globally
export const DialogCheckbox = findModuleExport(e =>
e.prototype &&
e?.prototype &&
typeof e?.prototype == "object" &&
"GetPanelElementProps" in e?.prototype &&
"SetChecked" in e?.prototype &&
"Toggle" in e?.prototype &&
// beta || stable as of oct 2 2024
(e?.prototype?.render?.toString().includes('="DialogCheckbox"') || (
(e?.prototype?.render?.toString?.().includes('="DialogCheckbox"') || (
e.contextType &&
e.prototype?.render?.toString().includes('fallback:')
e.prototype?.render?.toString?.().includes('fallback:')
))
) as FC<DialogCheckboxProps>;

0 comments on commit bf58e08

Please sign in to comment.