UNPKG

@git-temporal/git-temporal-react

Version:

<!-- START doctoc generated TOC please keep comment here to allow auto update --> <!-- DON'T EDIT THIS SECTION, INSTEAD RE-RUN doctoc TO UPDATE -->

10 lines (8 loc) 185 B
import { useRef, useEffect } from 'react'; export function usePrevious(value: any) { const ref = useRef(); useEffect(() => { ref.current = value; }); return ref.current; }