9.5.4: Server side rendering positioning breaks
See original GitHub issueWhen using Gatsby, the transforms of the diagrams will show off position
9.5.3

9.5.4

Code
import React from "react";
import ReactFlow, {
  ReactFlowProvider,
  addEdge,
  removeElements,
} from "react-flow-renderer";
const items = [
  {
    id: "1",
    data: {
      label: <>Label</>,
    },
    position: { x: 100, y: 0 },
  },
  {
    id: "2",
    data: { label: "Label 2" },
    position: {
      x: 100,
      y: 60,
    },
  },
  { id: "3", data: { label: "Label 3" }, position: { x: 100, y: 120 } },
  { id: "4", data: { label: "Label Four" }, position: { x: 100, y: 180 } },
  { id: "5", data: { label: "Label 5" }, position: { x: 100, y: 240 } },
  {
    id: "e1-2",
    source: "1",
    target: "2",
  },
  { id: "e2-3", source: "2", target: "3" },
  { id: "e3-4", source: "3", target: "4" },
  { id: "e4-5", source: "4", target: "5" },
];
export const ExampleChartFlow: React.FC = () => {
  const [elements, setElements] = React.useState(items);
  const onConnect = (params) => setElements((els) => addEdge(params, els));
  const onElementsRemove = (elementsToRemove) =>
    setElements((els) => removeElements(elementsToRemove, els));
  return (
    <ReactFlowProvider>
      <div className="reactflow-wrapper" style={{ height: "60vh" }}>
        <ReactFlow
          elements={elements}
          onConnect={onConnect}
          onElementsRemove={onElementsRemove}
          nodesDraggable={false}
          paneMoveable={false}
          zoomOnScroll={false}
          zoomOnPinch={false}
          zoomOnDoubleClick={false}
          onLoad={(reactFlowInstance) => {
            reactFlowInstance.fitView();
          }}
          snapToGrid={true}
          snapGrid={[15, 15]}
        />
      </div>
    </ReactFlowProvider>
  );
};
Issue Analytics
- State:
 - Created 2 years ago
 - Comments:11 (3 by maintainers)
 
Top Results From Across the Web
Server-side rendering - Apollo GraphQL Docs
Server -side rendering (SSR) is a performance optimization for modern web apps. It enables you to render your app's initial state to raw...
Read more >NextJS serverside Breakpoints possible? - Stack Overflow
I've got a debugger in my getInitialProps and it never breaks at that point. It only breaks when it's ran on the browser,...
Read more >Server Side Rendering in React – How it Works - eSketchers
In simple words, client-side rendering is the rendering of content in the browser using JavaScript. The process involves an HTML document, with ...
Read more >Server rendering - Material UI - MUI
The most common use case for server-side rendering is to handle the initial render when a user (or search engine crawler) first requests...
Read more >What is server-side rendering and how does it improve site ...
Server -side rendering (SSR) addresses the performance and search engine optimization issues of single-page JavaScript applications.
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found

@moklick Works for me too! (Tested with 9.6.0)
Works! 😃 Thanks