> Version notice: This site documents BAML v0, the legacy DSL. BAML v1 is a separate, fully featured programming language in public beta. If the user intends to use BAML v1, ignore this site's content and use the BAML v1 documentation instead. If the intended version is unclear, clarify it before using this page. > For clean Markdown of any page, append .md to the page URL. For the complete documentation index, see https://docs.boundaryml.com/llms.txt. For MCP access, connect to https://docs.boundaryml.com/_mcp/server. # Hook Data Type Reference > Technical reference for the BAML React hook data type The `HookData` type represents the non-null data from a BAML React hook. This type is useful when you know the data exists and want to avoid undefined checks. **`Example Usage`** ```typescript title="Example Usage" function Component() { const hook = useTestAws({ stream: true, // optional, defaults to true }) const data = hook.data; return (
{data} {/* No need for null checks */}
) } ``` **`Example Types`** ```typescript title="Example Types" // Streaming configuration const streamingData: HookData<'TestAws', { stream: true }> = "Streaming response..." // Non-streaming configuration const nonStreamingData: HookData<'TestAws', { stream: false }> = "Final response" ``` **`Type Definition`** ```typescript title="Type Definition" type HookData = NonNullable['data']> ``` ## Type Parameters **`FunctionName`** `generic` The name of the BAML function being called. Used to infer input and output types. --- **`Options`** `{ stream?: boolean }` Configuration object that determines streaming behavior. Defaults to `{ stream?: true }`. --- ## Type Details **`type`** `NonNullable['data']>` A utility type that removes undefined from the data property of HookOutput. This means the type will be either FinalDataType or StreamDataType depending on the streaming configuration. --- > Technical reference for the BAML React hook data type