chore(types): add tsdocs

This commit is contained in:
moklick
2025-02-11 17:57:21 +01:00
parent 7b0f96f017
commit 381ed2a5bf
34 changed files with 264 additions and 100 deletions
+11 -11
View File
@@ -5,8 +5,8 @@ import type { Node, Edge, OnNodesChange, OnEdgesChange } from '../types';
/**
* This hook makes it easy to prototype a controlled flow where you manage the
*state of nodes and edges outside the `ReactFlowInstance`. You can think of it
*like React's `useState` hook with an additional helper callback.
* state of nodes and edges outside the `ReactFlowInstance`. You can think of it
* like React's `useState` hook with an additional helper callback.
*
* @public
* @param initialNodes
@@ -34,10 +34,10 @@ import type { Node, Edge, OnNodesChange, OnEdgesChange } from '../types';
*}
*```
*
*@remarks This hook was created to make prototyping easier and our documentation
*examples clearer. Although it is OK to use this hook in production, in
*practice you may want to use a more sophisticated state management solution
*like Zustand {@link https://reactflow.dev/docs/guides/state-management/} instead.
* @remarks This hook was created to make prototyping easier and our documentation
* examples clearer. Although it is OK to use this hook in production, in
* practice you may want to use a more sophisticated state management solution
* like Zustand {@link https://reactflow.dev/docs/guides/state-management/} instead.
*
*/
export function useNodesState<NodeType extends Node>(
@@ -54,8 +54,8 @@ export function useNodesState<NodeType extends Node>(
/**
* This hook makes it easy to prototype a controlled flow where you manage the
*state of nodes and edges outside the `ReactFlowInstance`. You can think of it
*like React's `useState` hook with an additional helper callback.
* state of nodes and edges outside the `ReactFlowInstance`. You can think of it
* like React's `useState` hook with an additional helper callback.
*
* @public
* @param initialEdges
@@ -84,9 +84,9 @@ export function useNodesState<NodeType extends Node>(
*```
*
* @remarks This hook was created to make prototyping easier and our documentation
*examples clearer. Although it is OK to use this hook in production, in
*practice you may want to use a more sophisticated state management solution
*like Zustand {@link https://reactflow.dev/docs/guides/state-management/} instead.
* examples clearer. Although it is OK to use this hook in production, in
* practice you may want to use a more sophisticated state management solution
* like Zustand {@link https://reactflow.dev/docs/guides/state-management/} instead.
*
*/
export function useEdgesState<EdgeType extends Edge = Edge>(