• Returns an object only containing the differences between the two FormikValues.

    This method can be used to create the patch document sent to the PostGraphile endpoint.

    Please make sure to remove fields that can not be updated, or need to be updated using a different mutation, either already on the parameters passed to that method or on the returned object, before sending it to the API.

    Note: this function will just compare the values of each property. It will not compare values of nested array or objects.

    Type Parameters

    • T extends FormikValues

    Parameters

    • current: T

      the current values of the form

    • Optional initial: null | T

      the initial values of the form

    Returns Partial<T>

    Example

    getFormDiff({a: 2}, {a: 3})
    

Generated using TypeDoc