use-undo icon indicating copy to clipboard operation
use-undo copied to clipboard

Handle callbacks in set/redo calls

Open gorj-tessella opened this issue 3 years ago • 1 comments

Ordinary useState/setState accepts a callback as the argument which is evaluated with the previous state, so useUndo/set/reset should as well.

gorj-tessella avatar Mar 12 '21 14:03 gorj-tessella

Ordinary useState/setState accepts a callback as the argument which is evaluated with the previous state, so useUndo/set/reset should as well.

Would the typescript declaration have to be updated as well? https://github.com/homerchen19/use-undo/blob/master/index.d.ts

AntonioClarke avatar Mar 23 '21 01:03 AntonioClarke