diff --git a/packages/ibm-products/src/components/Coachmark/Coachmark.tsx b/packages/ibm-products/src/components/Coachmark/Coachmark.tsx index 371f763d84..bafacb3203 100644 --- a/packages/ibm-products/src/components/Coachmark/Coachmark.tsx +++ b/packages/ibm-products/src/components/Coachmark/Coachmark.tsx @@ -277,6 +277,11 @@ export let Coachmark = forwardRef( } ); +const overlayRefType = + typeof HTMLElement === 'undefined' + ? PropTypes.object + : PropTypes.instanceOf(HTMLElement); + // Return a placeholder if not released and not enabled by feature flag Coachmark = pkg.checkComponentEnabled(Coachmark, componentName); @@ -333,9 +338,7 @@ Coachmark.propTypes = { overlayKind: PropTypes.oneOf(['tooltip', 'floating', 'stacked']), overlayRef: PropTypes.shape({ - current: PropTypes.instanceOf( - HTMLElement - ) as PropTypes.Validator, + current: overlayRefType as PropTypes.Validator, }), /**