diff --git a/packages/react/src/context/actor.tsx b/packages/react/src/context/actor.tsx index e29a50085d..1ac86e52a7 100644 --- a/packages/react/src/context/actor.tsx +++ b/packages/react/src/context/actor.tsx @@ -64,9 +64,8 @@ import { extractActorContext } from "../helpers/extractActorContext" * }; * ``` * - * This function streamlines the process of setting up a context for IC actor interactions within a React app, making it easier - * to manage actor state and perform actions such as queries or updates. It abstracts away the complexities involved in directly - * managing IC agents and actors, providing a simple, declarative API for developers. + * This function streamlines the process of setting up a context for IC actor interactions within a React app, + * it provides a type-safe and efficient way to manage actor state and interactions. */ export function createActorContext( contextConfig: CreateActorContextParameters = {} diff --git a/packages/react/src/context/agent.tsx b/packages/react/src/context/agent.tsx index 42b7e3ee82..7967d4cab6 100644 --- a/packages/react/src/context/agent.tsx +++ b/packages/react/src/context/agent.tsx @@ -28,8 +28,8 @@ import { isInLocalOrDevelopment } from "../utils" * Hooks extracted from the created context for managing agent and authentication state within components. * * @example - * agent.ts * ```tsx + * // agent.ts * import { createAgentContext } from "@ic-reactor/react"; * import { CreateAgentCotextParameters } from "@ic-reactor/react/dist/types"; * @@ -50,11 +50,11 @@ import { isInLocalOrDevelopment } from "../utils" * useAgentManager, * useUserPrincipal, * } = createAgentContext(agentConfig); - * - * // Now you can use the returned hooks in your React components *``` - * App.tsx + * Now you can use the returned hooks in your React components + * * ```tsx + * // App.tsx * import React from 'react'; * import { AgentProvider } from './agent'; * diff --git a/packages/react/src/context/types.ts b/packages/react/src/context/types.ts index 108ad37085..faeb342884 100644 --- a/packages/react/src/context/types.ts +++ b/packages/react/src/context/types.ts @@ -53,5 +53,4 @@ export interface CreateActorContextParameters didjsId?: string canisterId?: string idlFactory?: IDL.InterfaceFactory - loadingComponent?: React.ReactNode } diff --git a/packages/react/src/provider/actor.ts b/packages/react/src/provider/actor.ts index 2cf495dcfc..84a4a7a19b 100644 --- a/packages/react/src/provider/actor.ts +++ b/packages/react/src/provider/actor.ts @@ -5,10 +5,12 @@ import { ActorHooks } from "../hooks/actor/hooks" * It wraps child components, providing them access to actor-specific hooks and functionalities based on the provided canister ID and configuration. * * Props: - * - `children`: React Node - The child components that will have access to the actor context. * - `canisterId` (optional): string - The Canister ID for actor interactions. If not provided, the default from `createActorContext` is used. + * - `idlFactory` (optional): IDL.InterfaceFactory - The IDL factory for the actor interface. If not provided, the default from `createActorContext` is used. + * - `didjsId` (optional): string - The DID.js ID for authentication. If not provided, the default from `createActorContext` is used. * - `loadingComponent` (optional): React Node - A component displayed during the loading/fetching state. Defaults to a simple message. - * - `...restConfig`: Additional configuration options that will be merged with the default configuration provided during context creation. + * - `authenticatingComponent` (optional): React Node - A component displayed during the authentication state. Defaults to a simple message. + * - `children`: React Node - The child components that will have access to the actor context. * * Behavior: * - Validates the presence of a `canisterId`. Throws an error if it is missing, ensuring that a valid canister ID is always used for actor operations. diff --git a/typedoc.json b/typedoc.json index a4058d1138..3d61be5e18 100644 --- a/typedoc.json +++ b/typedoc.json @@ -5,7 +5,7 @@ "name": "ic-reactor", "customTitle": "ic-reactor", "navigationLinks": { - "Examples": "https://github.com/B3Pay/ic-reactor/tree/main/examples", + "Example": "https://github.com/B3Pay/ic-reactor/tree/main/examples", "GitHub": "https://github.com/B3Pay/ic-reactor" }, "cleanOutputDir": true,