antd-crud-table API
    Preparing search index...

    Function defaultIdGenerator

    • Default identity policy for in-memory sources.

      Chooses from the runtime type of the existing keys rather than coercing them to numbers. Coercion was the old bug: Number('a3f9-...') is NaN, || 0 collapsed it to 0, and every created row came back as 1 - duplicate keys, and update/remove then resolving to the wrong record.

      • numeric keys -> highest + 1
      • digit-like strings -> highest + 1, kept as a string
      • any other string -> a fresh UUID
      • empty dataset -> 1, matching the previous behaviour for the common case

      Mixed or non-primitive key types cannot be continued safely, so those throw rather than silently colliding. Pass an explicit generator for those.

      Type Parameters

      • T
      • K extends string | number | symbol

      Parameters

      • key: K

      Returns IdGenerator<T, K>