ChemPal Documentation - v0.0.13-beta.5
    Preparing search index...

    Module components/SearchPanel/hooks

    Functions

    useAppContext

    React v19's use() hook can work with Context directly

    useOptimisticResults

    React v19 useOptimistic wrapper for streaming search results. Provides optimistic updates so the UI reflects new products the instant they arrive, before the full search has completed. React automatically rolls back the optimistic state if a transition that produced it is interrupted or errors.

    useOptimisticResultsWithPending

    Extended optimistic-results hook that tracks a per-item pending state. Each product passes through three lifecycle stages: add (pending) → confirm (persisted) or error (removed). This lets the UI render a loading indicator on rows that are not yet confirmed.

    useSearch

    React v19 enhanced search hook that maintains streaming behavior.