Entracte (TypeScript)
    Preparing search index...

    Function useLocalDraft

    • Editable local copy of a value derived from upstream state (typically a setting), re-seeded whenever deps change — e.g. when the active profile swaps the underlying setting out from under an open textarea.

      compute produces both the initial draft and each re-seed. It is read through a ref so callers can pass a fresh closure every render without having to add it to deps.

      Type Parameters

      • T

      Parameters

      Returns [T, Dispatch<SetStateAction<T>>]