UNPKG

@tacky/store

Version:

State management framework based on react

12 lines (8 loc) 217 B
import { useState, useCallback } from 'react'; export function useForceUpdate() { const [, setTick] = useState(0); const update = useCallback(() => { setTick(tick => tick + 1); }, []); return update; }