@paul-portfolio/react 0.8.0 → 0.8.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/GuidedTour.js +4 -1
- package/package.json +1 -1
package/dist/GuidedTour.js
CHANGED
|
@@ -107,7 +107,10 @@ export function GuidedTour({ open, steps, onClose, onFinish, 'aria-label': ariaL
|
|
|
107
107
|
previouslyFocused?.focus?.();
|
|
108
108
|
};
|
|
109
109
|
}, [open, onClose]);
|
|
110
|
-
|
|
110
|
+
// No document on the server, and the overlay portals to it — render nothing
|
|
111
|
+
// there rather than reaching createPortal(document.body). A host that opens
|
|
112
|
+
// the tour during SSR then gets a clean no-op instead of a crash.
|
|
113
|
+
if (!open || !current || typeof document === 'undefined')
|
|
111
114
|
return null;
|
|
112
115
|
const go = (target) => {
|
|
113
116
|
const clamped = Math.max(0, Math.min(steps.length - 1, target));
|