refactor(react): pass fitView for ssr

This commit is contained in:
moklick
2023-10-23 16:01:22 +02:00
parent f2b36f2d33
commit 52a47a7a26
5 changed files with 20 additions and 5 deletions
@@ -12,12 +12,14 @@ function ReactFlowProvider({
initialEdges,
initialWidth,
initialHeight,
fitView,
}: {
children: ReactNode;
initialNodes?: Node[];
initialEdges?: Edge[];
initialWidth?: number;
initialHeight?: number;
fitView?: boolean;
}) {
const storeRef = useRef<UseBoundStoreWithEqualityFn<StoreApi<ReactFlowState>> | null>(null);
@@ -27,6 +29,7 @@ function ReactFlowProvider({
edges: initialEdges,
width: initialWidth,
height: initialHeight,
fitView,
});
}