Improve TSDoc comments for useEdges, useInternalNode, useNodes and useNodeId hooks

This commit is contained in:
Dimitri POSTOLOV
2025-04-05 17:44:33 +02:00
parent b9e4f82933
commit 934ea42d9a
5 changed files with 10 additions and 5 deletions
+5
View File
@@ -0,0 +1,5 @@
---
'@xyflow/react': patch
---
Improve TSDoc comments for `useEdges`, `useInternalNode`, `useNodes` and `useNodeId` hooks
+1 -1
View File
@@ -10,7 +10,7 @@ export const Consumer = NodeIdContext.Consumer;
* drill down the id as a prop. * drill down the id as a prop.
* *
* @public * @public
* @returns id of the node * @returns The id for a node in the flow.
* *
* @example * @example
*```jsx *```jsx
+1 -1
View File
@@ -10,7 +10,7 @@ const edgesSelector = (state: ReactFlowState) => state.edges;
* will re-render **whenever any edge changes**. * will re-render **whenever any edge changes**.
* *
* @public * @public
* @returns An array of edges * @returns An array of all edges currently in the flow.
* *
* @example * @example
* ```tsx * ```tsx
+2 -2
View File
@@ -10,8 +10,8 @@ import type { InternalNode, Node } from '../types';
* including when a node is selected or moved. * including when a node is selected or moved.
* *
* @public * @public
* @param id - id of the node * @param id - The ID of a node you want to observe.
* @returns array with visible node ids * @returns The `InternalNode` object for the node with the given ID.
* *
* @example * @example
* ```tsx * ```tsx
+1 -1
View File
@@ -11,7 +11,7 @@ const nodesSelector = (state: ReactFlowState) => state.nodes;
* or moved. * or moved.
* *
* @public * @public
* @returns An array of nodes * @returns An array of all nodes currently in the flow.
* *
* @example * @example
* ```jsx * ```jsx