fix(DialogCheckbox): prevent some potential issues in dialogcheckbox

This commit is contained in:
AAGaming
2024-10-11 14:59:42 -04:00
parent e965816144
commit bf58e08e4b

View File

@@ -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>;