fix(react): window bug

This commit is contained in:
moklick
2024-06-20 15:53:35 +02:00
parent 7338eab8c9
commit 71db83761c
4 changed files with 7 additions and 3 deletions

View File

@@ -1,5 +1,9 @@
# @xyflow/react
## 12.0.0-next.24
- fix `window` bug for SSR for real
## 12.0.0-next.23
- fix `window` bug for SSR

View File

@@ -1,6 +1,6 @@
{
"name": "@xyflow/react",
"version": "12.0.0-next.23",
"version": "12.0.0-next.24",
"description": "React Flow - A highly customizable React library for building node-based editors and interactive flow charts.",
"keywords": [
"react",

View File

@@ -28,7 +28,7 @@ export type FlowRendererProps<NodeType extends Node = Node> = Omit<
children: ReactNode;
};
const win = typeof window === 'undefined' ? window : undefined;
const win = typeof window !== 'undefined' ? window : undefined;
const selector = (s: ReactFlowState) => {
return { nodesSelectionActive: s.nodesSelectionActive, userSelectionActive: s.userSelectionActive };

View File

@@ -9,7 +9,7 @@ import { Edge, Node } from '../types';
const selected = (item: Node | Edge) => item.selected;
const deleteKeyOptions: UseKeyPressOptions = { actInsideInputWithModifier: false };
const win = typeof window === 'undefined' ? window : undefined;
const win = typeof window !== 'undefined' ? window : undefined;
/**
* Hook for handling global key events.