how to set default edge type when using typescript
See original GitHub issueI am trying to set the default edge type to step. The documentation shows that the react flow component takes an edge type prop with the default one being :
{
default: BezierEdge,
straight: StraightEdge,
step: StepEdge,
smoothstep: SmoothStepEdge
}
So I would like to make mine be something like:
{
default: StepEdge,
straight: StraightEdge,
smoothstep: SmoothStepEdge
}
However I cant seem to find out how to import the edge types in order to make the above object. Any hints on how to accomplish this?
Issue Analytics
- State:
- Created 2 years ago
- Comments:8 (4 by maintainers)
Top Results From Across the Web
Typing defaultProps - React TypeScript Cheatsheets
The consensus is to use object default values. Function Components: type GreetProps = { age?: number }; const Greet = ({ age =...
Read more >TSConfig Reference - Docs on every TSConfig option
The path may use Node.js style resolution. ... are included (e.g. .ts , .tsx , and .d.ts by default, with .js and .jsx...
Read more >How to set default value to param that has type keyof (from an ...
I am having trouble in Typescript passing default values ...
Read more >Default Props in React/TypeScript - DEV Community
I'm not gonna go through a tutorial on that here. Suffice it to say that AllPropsRequired is a type that will make all...
Read more >TypeScript Programming with Visual Studio Code
Another option is to install the TypeScript compiler locally in your project ( npm install --save-dev typescript ) and has the benefit of...
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

Resolved
const onConnect = useCallback((params)=> setEdges(addEdge({...params, type:"smoothstep"}, edges)) );Thanks for your support
That did it! Thanks! Is there a way to change the path that gets displayed when you are connecting nodes? ie right now when I click on a handle and drag the bezier path is drawn, is that configurable somehow?
Edit: found it!