Kvaser CanKing GUI Extensions SDK v7.6.1


Kvaser CanKing GUI Extensions SDK / hooks / useUndoRef

Function: useUndoRef()

useUndoRef<T>(initialState?): IUndoObject<T>

Custom hook to manage undo/redo state using a ref (does not trigger re-renders by default).

Type Parameters

T

T

The type of the undo/redo data.

Parameters

initialState?

IUndoState<T>

The initial undo state.

Returns

IUndoObject<T>

An undo object for managing state history.

Remarks

This hook uses useRef and does not automatically trigger component re-renders. Use the subscribe method if you need to trigger re-renders on state changes, or use useUndo instead.