79403147

Date: 2025-01-31 15:07:14
Score: 0.5
Natty:
Report link

add "use client"; on the top of the source code, this will fix the error

"use client";


import { Workflow } from "@prisma/client";
import React from "react";
import { ReactFlow, useEdgesState, useNodesState } from "@xyflow/react";

import "@xyflow/react/dist/style.css";

function FlowEditor({ workflow }: { workflow: Workflow }) {

  const [nodes, setNodes, onChangeNodes] = useNodesState([]);
  const [edges, setEdges, onChangeEdges] = useEdgesState([]);


  return (
    <main className="h-full w-full">
      <ReactFlow
        nodes={nodes}
        edges={edges}
        onNodesChange={onChangeNodes}
        onEdgesChange={onChangeEdges}
      >

      </ReactFlow>
    </main>
  );
}

export default FlowEditor;
Reasons:
  • Long answer (-0.5):
  • Has code block (-0.5):
  • Self-answer (0.5):
  • Low reputation (1):
Posted by: Shykat Himu