diff --git a/examples/astro-xyflow/src/components/ReactFlowExample/index.tsx b/examples/astro-xyflow/src/components/ReactFlowExample/index.tsx
index 4f8ef0ab..863458fb 100644
--- a/examples/astro-xyflow/src/components/ReactFlowExample/index.tsx
+++ b/examples/astro-xyflow/src/components/ReactFlowExample/index.tsx
@@ -81,6 +81,8 @@ const initialNodes: Node[] = [
id: '4',
data: { label: 'Node 4' },
position: { x: 400, y: 200 },
+ width: 200,
+ height: 50,
type: 'custom',
},
];
diff --git a/examples/astro-xyflow/src/components/ReactFlowInitialExample/CustomNode.tsx b/examples/astro-xyflow/src/components/ReactFlowInitialExample/CustomNode.tsx
new file mode 100644
index 00000000..c7fae3d8
--- /dev/null
+++ b/examples/astro-xyflow/src/components/ReactFlowInitialExample/CustomNode.tsx
@@ -0,0 +1,21 @@
+import { memo, useState } from 'react';
+import { Handle, Position } from '@xyflow/react';
+
+function CustomNode() {
+ const [text, setText] = useState('this is a pretty long text');
+
+ return (
+ <>
+
+
+
+
setText(e.target.value)} />
+
text: {text}
+
+
+
+ >
+ );
+}
+
+export default memo(CustomNode);
diff --git a/examples/astro-xyflow/src/components/ReactFlowInitialExample/index.tsx b/examples/astro-xyflow/src/components/ReactFlowInitialExample/index.tsx
new file mode 100644
index 00000000..b3f99a6b
--- /dev/null
+++ b/examples/astro-xyflow/src/components/ReactFlowInitialExample/index.tsx
@@ -0,0 +1,69 @@
+import { useCallback } from 'react';
+import {
+ ReactFlow,
+ addEdge,
+ useEdgesState,
+ useNodesState,
+ Background,
+ Controls,
+ type Connection,
+ type Edge,
+ type Node,
+} from '@xyflow/react';
+
+import CustomNode from './CustomNode';
+
+import '@xyflow/react/dist/style.css';
+
+const initialNodes: Node[] = [
+ {
+ id: '1',
+ data: {},
+ position: { x: 0, y: 0 },
+ initialWidth: 200,
+ initialHeight: 50,
+ type: 'custom',
+ },
+ {
+ id: '2',
+ data: {},
+ position: { x: 0, y: 200 },
+ width: 200,
+ initialHeight: 50,
+ type: 'custom',
+ },
+];
+
+const initialEdges: Edge[] = [{ id: 'e1-2', source: '1', target: '2' }];
+
+const nodeTypes = {
+ custom: CustomNode,
+};
+
+function Flow() {
+ const [nodes, , onNodesChange] = useNodesState(initialNodes);
+ const [edges, setEdges, onEdgesChange] = useEdgesState(initialEdges);
+ const onConnect = useCallback((params: Connection | Edge) => setEdges((eds) => addEdge(params, eds)), [setEdges]);
+
+ return (
+
+
+
+
+
+
+ );
+}
+
+export default Flow;
diff --git a/examples/astro-xyflow/src/components/SvelteFlowInitialExample/CustomNode.svelte b/examples/astro-xyflow/src/components/SvelteFlowInitialExample/CustomNode.svelte
new file mode 100644
index 00000000..5bef87c9
--- /dev/null
+++ b/examples/astro-xyflow/src/components/SvelteFlowInitialExample/CustomNode.svelte
@@ -0,0 +1,25 @@
+
+
+
+
+
+
+
diff --git a/examples/astro-xyflow/src/components/SvelteFlowInitialExample/index.svelte b/examples/astro-xyflow/src/components/SvelteFlowInitialExample/index.svelte
new file mode 100644
index 00000000..8fbe4905
--- /dev/null
+++ b/examples/astro-xyflow/src/components/SvelteFlowInitialExample/index.svelte
@@ -0,0 +1,39 @@
+
+
+
+
+
+
+
+
diff --git a/examples/astro-xyflow/src/pages/index.astro b/examples/astro-xyflow/src/pages/index.astro
index be9d1885..d7b14558 100644
--- a/examples/astro-xyflow/src/pages/index.astro
+++ b/examples/astro-xyflow/src/pages/index.astro
@@ -1,6 +1,8 @@
---
-import ReactFlowApp from '../components/ReactFlowExample'
-import SvelteFlowApp from '../components/SvelteFlowExample/index.svelte'
+import ReactFlowApp from '../components/ReactFlowExample';
+import ReactFlowInitialApp from '../components/ReactFlowInitialExample';
+import SvelteFlowApp from '../components/SvelteFlowExample/index.svelte';
+import SvelteFlowInitialApp from '../components/SvelteFlowInitialExample/index.svelte';
---
@@ -18,10 +20,24 @@ import SvelteFlowApp from '../components/SvelteFlowExample/index.svelte'
+ React Flow
+ no client hydration
+
+
+ client hydration on load (client:load)
+
+
+ client hydration on load (client:load) and initialWidth / initialHeight
+
+
Svelte Flow
- React Flow
-
+ client hydration on load (client:load)
+
+
+ client hydration on load (client:load) and initialWidth / initialHeight
+
+