Skip to content

Document how to use BuiltInEdge type, so that pathOptions works properly #485

@bcakmakoglu

Description

@bcakmakoglu

Describe the Bug

In v11 the typing for the Edge type allows pathOptions for the default edge-types (bezier, step and smoothstep) while in v12 pathOptions is not recognized anymore and will cause TypeScript to report an error for it even though the options are still taken and passed to the edge component.

Your Example Website or App

No response

Steps to Reproduce the Bug or Issue

Set up a basic v12 example and use sth like this

const initialEdges: Edge[] = [
  // Error: Object literal may only specify known properties, and pathOptions does not exist in type Edge
  { id: 'e1-2', type: 'smoothstep', pathOptions: { borderRadius: 100 }, source: '1', target: '2', animated: true },
];

Expected behavior

pathOptions should be a valid property on the default edge types previously mentioned.

Screenshots or Videos

No response

Platform

  • OS: [e.g. macOS, Windows, Linux]
  • Browser: [e.g. Chrome, Safari, Firefox]
  • Version: [e.g. 91.1]

Additional context

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    react-docsIssues belonging to the reactflow websitesvelte-docsIssues belonging to the svelteflow website

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions