Comments (5)
After spending time on Next.JS, I think I fixed this error
Instead doing 1 line import
import { SmartEdge, SmartEdgeProvider } from "@tisoap/react-flow-smart-edge";
I changed to this:
import dynamic from "next/dynamic";
const SmartEdgeProvider = dynamic(
async () => {
const { SmartEdgeProvider } = await import("@tisoap/react-flow-smart-edge");
return SmartEdgeProvider;
},
{ ssr: false }
);
const SmartEdge = dynamic(
async () => {
const { SmartEdge } = await import("@tisoap/react-flow-smart-edge");
return SmartEdge;
},
{ ssr: false }
);
You need to update the document for NextJS.
from react-flow-smart-edge.
Hey @AnhHuy02 , thanks for figuring out how to make this library work under Next.js! I'll test this first before making changes to readme
from react-flow-smart-edge.
@AnhHuy02 I just tested it under Next.js and could not replicate this problem, I was able to use named imports with no errors on the browser. Could you share a minimal example on CodeSandbox or a minimal GitHub repo where the error happens?
from react-flow-smart-edge.
Here: https://codesandbox.io/s/trusting-pare-294d7t?file=/components/app.js
For some reason, I did one line import and it still work. That's weird.
Maybe if a large complex dataset will cause the path finding function in your library take more time to execute.
from react-flow-smart-edge.
I still saw no error in the sandbox you sent. I noticed you're using older versions of both react-flow-renderer
and @tisoap/react-flow-smart-edge
, please upgrade to their respective latest versions and try again. Here's a working CodeSandbox: https://codesandbox.io/s/smart-edge-nextjs-xx6oo4
from react-flow-smart-edge.
Related Issues (20)
- Create templates for new issues
- Update Sponsor Badge
- Diagram becomes unresponsive with large data HOT 7
- Add draggable point to smart edge HOT 4
- Update to be compatible with React Flow 11 HOT 5
- In version 3.0 Beta - Edge between 2 nodes goes away if the nodes are close to each other HOT 3
- Props that are generated when you start dragging new connection are missing for <StepEdge /> in react flow v11 HOT 2
- Make edges not overlap each other HOT 1
- Connection line appears broken when using specific grid snapping HOT 3
- Connection line appears broken when using specific grid snapping HOT 1
- Demo page/Storybook is no longer working HOT 2
- Smart Edge Not Considering nodes inside a group. HOT 2
- Edges not starting/ending on XY coords HOT 1
- Bending of edge from source HOT 4
- Edge labels getting overlapped HOT 6
- Add SmoothStepPath HOT 3
- edgeCenterX and edgeCenterY sometimes aren't calculated properly! HOT 1
- Option to propagate exceptions outside of getSmartEdge HOT 2
- engine warning when installing latest version HOT 2
- Add helper function for EdgeTypes and Options
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from react-flow-smart-edge.