Merge pull request #5159 from dimaMachina/tsdoc2-5

Improve TSDoc comments for `useConnection` hook
This commit is contained in:
Moritz Klack
2025-04-06 20:57:39 +02:00
committed by GitHub
2 changed files with 9 additions and 0 deletions

View File

@@ -0,0 +1,5 @@
---
'@xyflow/react': patch
---
Improve TSDoc comments for `useConnection` hook

View File

@@ -30,6 +30,10 @@ function getSelector<NodeType extends Node = Node, SelectorReturn = ConnectionSt
* based on a certain condition (e.g. if the connection is valid or not).
*
* @public
* @param connectionSelector - An optional selector function used to extract a slice of the
* `ConnectionState` data. Using a selector can prevent component re-renders where data you don't
* otherwise care about might change. If a selector is not provided, the entire `ConnectionState`
* object is returned unchanged.
* @example
*
* ```tsx